mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 13:34:03 +00:00
import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1132854 - Remove the gfx::ToIntSize conversion helper. r=Bas (0ee451e53) - Bug 1020179 - Let PContent manage PContentPermissionRequest. r=fabrice, r=khuey (caf96b54e) - Bug 1153023 - Convert TabParent::mChromeOffset to a LayoutDeviceIntPoint. r=billm (ba338584a) - Bug 1139033 - Don't schedule an unnecessary repeat transaction when doing a non-progressive paint. r=nical (9c77d9318) - Bug 1137203 - Ignore the critical displayport when a layer is subject to OMTA relative to the scrolling ancestor. r=BenWa (c9bedfb1e) - Bug 1137203 - Cleanup to ditch the fast-path code entirely and just prevent progressive drawing in the equivalent scenarios. r=BenWa (6bc5b8813) - Bug 1128042 - Don't round critical displayport out as it should already be tile aligned and rounding error can increase tile usage. r=botond (03e34e2c5) - Bug 1149461 - Disable progressive drawing unless the compositor is actively scrolling a tiled layer. r=nical (7a3de28cb) - Bug 1152838 - Correctly inflate valid regions to tile boundaries. r=mattwoodrow (7a496f645) - Bug 1148971 - Make nsITheme::GetMinimumWidgetSize return a LayoutDeviceIntSize result instead of the unit-less nsIntSize type. r=roc (c34ddc478) - Bug 1155621 - Make nsIntRect and nsIntPoint typedefs of mozilla::gfx::IntRect and mozilla::gfx::IntPoint. r=Bas (9901a37f6) - Bug 1156632 - Remove unused forward class declarations - patch 5 - rdf, parser, layout and something else, r=ehsan (794739bd3) - Bug 1156632 - Remove unused forward class declarations - patch 6 - the rest of the tree, r=ehsan (63a2c4cb4) - Bug 1161634 - Allow synthesizing native mouse-scroll events on Linux. r=karlt (b88c1f367) - Bug 1161634 - Enable the test_wheel_scroll on Linux as well. r=mstange (7dab62ad4) - Bug 1144643 - Render tooltips as transparent on Gtk3. r=karlt (80f7fa312) - Bug 1174966 part 1 - Change type of mCancelledPointerLockRequests field from uint32_t to bit field. r=smaug (ef235c33e) - Bug 1155030 - Fix asterix/asterisk misspelling. r=ehsan (edb769304) - Bug 1149194 - Don't use uninitialized value in ComputedTimingFunction::operator==. r=bbirtles (6bc804d45) - Bug 1151346 - Make ActiveLayerTracker::IsOffsetOrMarginStyleAnimated respect CSS animations. r=roc (2c3f24ba0) - Bug 1151346 - Back out the important part again because of bug 1151889. (002b0e67b) - Bug 1122414 part 1 - Factor out a TransitionProperty method in ElementPropertyTransition; r=jwatt (ddbbdb04c) - Bug 1122414 part 2 - Return the transitionProperty from Animation.name for CSS transitions; r=jwatt (689251b93) - Bug 1122414 part 3 - Update DevTools tests to expect a name for transitions; r=pbrosset (f0d7e57e9) - Bug 1149999 - 1 - Display transition names in animation-panel now that they have names; r=past (ea3d8d552) - Bug 1120343 - 1 - Allow setting animations' currentTime by clicking/dragging the timeline; r=miker (936996d21) - Bug 1120343 - 2 - Add rewind and fast-forward buttons to animation player widgets; r=miker (95eddc465) - Bug 1120343 - 3 - Tests for the current time control in the animation panel; r=miker (b8a93f858) - Bug 1110762 - Add a setCurrentTime method to the animation actor; r=past (d0dae8967) - Bug 1123851 - 1 - Element geometry highlighter; r=bgrins (89b1a83bf) - Bug 1123851 - 2 - Tests for the element geometry highlighter; r=bgrins (7542bcab0) - add missing part of accessing first element from Bug 1139925 - Make the BoxModelHighlighter highlight all quads (b5c6076c1) - Bug 1139186 - 1 - Refactor to the native anon nodes manipulation in highlighters; r=bgrins (a454aefbf) - Bug 1139186 - 2 - Add event handling support to CanvasFrameAnonymousContentHelper; r=bgrins (a705c2716) - Bug 1120339 - Add setPlaybackRate method to AnimationPlayerActor; r=past (efa167a19) - Bug 1120833 - 2 - Fire events about changed animations in the AnimationsActor; r=past (4b5fddd23) - Bug 1120833 - 1 - Remove EventEmitter usage in AnimationPlayerFront (21186e616)
This commit is contained in:
@@ -17,8 +17,6 @@ class AccessibleWrap;
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
||||
struct MaiUtilClass;
|
||||
|
||||
extern "C" {
|
||||
void actionInterfaceInitCB(AtkActionIface* aIface);
|
||||
void componentInterfaceInitCB(AtkComponentIface* aIface);
|
||||
|
||||
@@ -300,7 +300,7 @@ nsCoreUtils::ScrollFrameToPoint(nsIFrame *aScrollableFrame,
|
||||
return;
|
||||
|
||||
nsPoint point =
|
||||
aPoint.ToAppUnits(aFrame->PresContext()->AppUnitsPerDevPixel());
|
||||
ToAppUnits(aPoint, aFrame->PresContext()->AppUnitsPerDevPixel());
|
||||
nsRect frameRect = aFrame->GetScreenRectInAppUnits();
|
||||
nsPoint deltaPoint(point.x - frameRect.x, point.y - frameRect.y);
|
||||
|
||||
|
||||
@@ -15,15 +15,14 @@
|
||||
#include "nsString.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsRefPtrHashtable.h"
|
||||
#include "nsRect.h"
|
||||
|
||||
struct nsRoleMapEntry;
|
||||
|
||||
struct nsRect;
|
||||
class nsIFrame;
|
||||
class nsIAtom;
|
||||
struct nsIntRect;
|
||||
class nsIPersistentProperties;
|
||||
class nsView;
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
@@ -39,7 +38,6 @@ class HTMLLIAccessible;
|
||||
class HyperTextAccessible;
|
||||
class ImageAccessible;
|
||||
class KeyBinding;
|
||||
class MathMLAccessible;
|
||||
class ProxyAccessible;
|
||||
class Relation;
|
||||
class RootAccessible;
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
|
||||
class nsAccessiblePivot;
|
||||
|
||||
class nsIScrollableView;
|
||||
|
||||
const uint32_t kDefaultCacheLength = 128;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@@ -977,7 +977,7 @@ HyperTextAccessible::OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType)
|
||||
|
||||
nsPresContext* presContext = mDoc->PresContext();
|
||||
nsPoint coordsInAppUnits =
|
||||
coords.ToAppUnits(presContext->AppUnitsPerDevPixel());
|
||||
ToAppUnits(coords, presContext->AppUnitsPerDevPixel());
|
||||
|
||||
nsRect frameScreenRect = hyperFrame->GetScreenRectInAppUnits();
|
||||
if (!frameScreenRect.Contains(coordsInAppUnits.x, coordsInAppUnits.y))
|
||||
@@ -1505,7 +1505,7 @@ HyperTextAccessible::ScrollSubstringToPoint(int32_t aStartOffset,
|
||||
|
||||
nsPresContext* presContext = frame->PresContext();
|
||||
nsPoint coordsInAppUnits =
|
||||
coords.ToAppUnits(presContext->AppUnitsPerDevPixel());
|
||||
ToAppUnits(coords, presContext->AppUnitsPerDevPixel());
|
||||
|
||||
bool initialScrolled = false;
|
||||
nsIFrame *parentFrame = frame;
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
#include "BaseAccessibles.h"
|
||||
|
||||
class nsGenericHTMLElement;
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
#include "HTMLFormControlAccessible.h"
|
||||
|
||||
class nsIMutableArray;
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "TableAccessible.h"
|
||||
#include "TableCellAccessible.h"
|
||||
|
||||
class nsITableLayout;
|
||||
class nsITableCellLayout;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@@ -20,11 +20,7 @@ class Accessible;
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
||||
class nsINode;
|
||||
class nsIContent;
|
||||
class nsIFrame;
|
||||
class nsIPresShell;
|
||||
class nsPluginFrame;
|
||||
|
||||
// 0e7e6879-854b-4260-bc6e-525b5fb5cf34
|
||||
#define NS_IACCESSIBILITYSERVICE_IID \
|
||||
|
||||
@@ -8,9 +8,9 @@ include protocol PContent;
|
||||
|
||||
include "mozilla/GfxMessageUtils.h";
|
||||
|
||||
using struct nsIntPoint from "nsRect.h";
|
||||
using struct nsIntRect from "nsRect.h";
|
||||
using nsIntRect from "nsRect.h";
|
||||
using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
|
||||
using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
@@ -135,7 +135,7 @@ child:
|
||||
prio(high) sync PasteText(uint64_t aID, int32_t aPosition)
|
||||
returns(bool aValid);
|
||||
|
||||
prio(high) sync ImagePosition(uint64_t aID, uint32_t aCoordType) returns(nsIntPoint aRetVal);
|
||||
prio(high) sync ImagePosition(uint64_t aID, uint32_t aCoordType) returns(IntPoint aRetVal);
|
||||
prio(high) sync ImageSize(uint64_t aID) returns(IntSize aRetVal);
|
||||
|
||||
prio(high) sync StartOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk);
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
struct objc_class;
|
||||
|
||||
class RootAccessibleWrap : public RootAccessible
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsRefPtrHashtable.h"
|
||||
|
||||
class nsIArray;
|
||||
class nsIContent;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
#include "XULMenuAccessible.h"
|
||||
#include "XULSelectControlAccessible.h"
|
||||
|
||||
class nsIWeakReference;
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "nsISupports.h"
|
||||
|
||||
class nsIURI;
|
||||
class nsString;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsILoadContext.h"
|
||||
|
||||
class mozIApplication;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
/**
|
||||
|
||||
@@ -88,7 +88,6 @@ class nsIURIFixup;
|
||||
class nsIURILoader;
|
||||
class nsIWebBrowserFind;
|
||||
class nsIWidget;
|
||||
class ProfilerMarkerTracing;
|
||||
|
||||
/* load commands were moved to nsIDocShell.h */
|
||||
/* load types were moved to nsDocShellLoadTypes.h */
|
||||
|
||||
@@ -14,9 +14,9 @@ interface nsIPrintSettings;
|
||||
|
||||
%{ C++
|
||||
#include "nsTArray.h"
|
||||
#include "nsRect.h"
|
||||
|
||||
class nsIWidget;
|
||||
struct nsIntRect;
|
||||
class nsIPresShell;
|
||||
class nsPresContext;
|
||||
class nsView;
|
||||
|
||||
@@ -13,7 +13,6 @@ class nsIContent;
|
||||
class nsIDocShell;
|
||||
class nsIInputStream;
|
||||
class nsIRequest;
|
||||
class nsString;
|
||||
|
||||
// Interface ID for nsILinkHandler
|
||||
#define NS_ILINKHANDLER_IID \
|
||||
|
||||
@@ -22,7 +22,7 @@ interface nsIStructuredCloneContainer;
|
||||
interface nsIBFCacheEntry;
|
||||
|
||||
%{C++
|
||||
struct nsIntRect;
|
||||
#include "nsRect.h"
|
||||
class nsDocShellEditorData;
|
||||
class nsSHEntryShared;
|
||||
%}
|
||||
|
||||
@@ -282,6 +282,18 @@ Animation::GetAnimationOfProperty(nsCSSProperty aProperty) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
Animation::HasAnimationOfProperties(const nsCSSProperty* aProperties,
|
||||
size_t aPropertyCount) const
|
||||
{
|
||||
for (size_t i = 0; i < aPropertyCount; i++) {
|
||||
if (HasAnimationOfProperty(aProperties[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
Animation::ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
|
||||
nsCSSPropertySet& aSetProperties)
|
||||
|
||||
@@ -116,8 +116,9 @@ public:
|
||||
uint32_t GetSteps() const { return mSteps; }
|
||||
bool operator==(const ComputedTimingFunction& aOther) const {
|
||||
return mType == aOther.mType &&
|
||||
mTimingFunction == aOther.mTimingFunction &&
|
||||
mSteps == aOther.mSteps;
|
||||
(mType == nsTimingFunction::Function ?
|
||||
mTimingFunction == aOther.mTimingFunction :
|
||||
mSteps == aOther.mSteps);
|
||||
}
|
||||
bool operator!=(const ComputedTimingFunction& aOther) const {
|
||||
return !(*this == aOther);
|
||||
@@ -248,7 +249,7 @@ public:
|
||||
return mTiming;
|
||||
}
|
||||
|
||||
const nsString& Name() const {
|
||||
virtual const nsString& Name() const {
|
||||
return mName;
|
||||
}
|
||||
|
||||
@@ -314,6 +315,8 @@ public:
|
||||
bool HasAnimationOfProperty(nsCSSProperty aProperty) const {
|
||||
return GetAnimationOfProperty(aProperty) != nullptr;
|
||||
}
|
||||
bool HasAnimationOfProperties(const nsCSSProperty* aProperties,
|
||||
size_t aPropertyCount) const;
|
||||
const InfallibleTArray<AnimationProperty>& Properties() const {
|
||||
return mProperties;
|
||||
}
|
||||
|
||||
@@ -16,8 +16,9 @@ test(function(t) {
|
||||
div.style.transition = 'all 100s';
|
||||
div.style.left = '100px';
|
||||
|
||||
assert_equals(div.getAnimations()[0].source.effect.name, '',
|
||||
'Animation effects for transitions have an empty name');
|
||||
assert_equals(div.getAnimations()[0].source.effect.name, 'left',
|
||||
'The name for the transitions corresponds to the property ' +
|
||||
'being transitioned');
|
||||
}, 'Effect name for transitions');
|
||||
|
||||
</script>
|
||||
|
||||
@@ -456,7 +456,7 @@ FragmentOrElement::Children()
|
||||
|
||||
if (!slots->mChildrenList) {
|
||||
slots->mChildrenList = new nsContentList(this, kNameSpaceID_Wildcard,
|
||||
nsGkAtoms::_asterix, nsGkAtoms::_asterix,
|
||||
nsGkAtoms::_asterisk, nsGkAtoms::_asterisk,
|
||||
false);
|
||||
}
|
||||
|
||||
|
||||
@@ -405,8 +405,8 @@ nsContentList::nsContentList(nsINode* aRootNode,
|
||||
mFuncMayDependOnAttr(false)
|
||||
{
|
||||
NS_ASSERTION(mRootNode, "Must have root");
|
||||
if (nsGkAtoms::_asterix == mHTMLMatchAtom) {
|
||||
NS_ASSERTION(mXMLMatchAtom == nsGkAtoms::_asterix, "HTML atom and XML atom are not both asterix?");
|
||||
if (nsGkAtoms::_asterisk == mHTMLMatchAtom) {
|
||||
NS_ASSERTION(mXMLMatchAtom == nsGkAtoms::_asterisk, "HTML atom and XML atom are not both asterisk?");
|
||||
mMatchAll = true;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
* 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 <map>
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
#include "GonkPermission.h"
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#endif // MOZ_WIDGET_GONK
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/PContentPermission.h"
|
||||
#include "mozilla/dom/PermissionMessageUtils.h"
|
||||
@@ -24,11 +26,82 @@
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsWeakPtr.h"
|
||||
|
||||
using mozilla::unused; // <snicker>
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla;
|
||||
|
||||
#define kVisibilityChange "visibilitychange"
|
||||
|
||||
NS_IMPL_ISUPPORTS(VisibilityChangeListener, nsIDOMEventListener)
|
||||
|
||||
VisibilityChangeListener::VisibilityChangeListener(nsPIDOMWindow* aWindow)
|
||||
{
|
||||
MOZ_ASSERT(aWindow);
|
||||
|
||||
mWindow = do_GetWeakReference(aWindow);
|
||||
nsCOMPtr<nsIDocument> doc = aWindow->GetExtantDoc();
|
||||
if (doc) {
|
||||
doc->AddSystemEventListener(NS_LITERAL_STRING(kVisibilityChange),
|
||||
/* listener */ this,
|
||||
/* use capture */ true,
|
||||
/* wants untrusted */ false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
VisibilityChangeListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||
{
|
||||
nsAutoString type;
|
||||
aEvent->GetType(type);
|
||||
if (!type.EqualsLiteral(kVisibilityChange)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> doc =
|
||||
do_QueryInterface(aEvent->InternalDOMEvent()->GetTarget());
|
||||
MOZ_ASSERT(doc);
|
||||
|
||||
if (mCallback) {
|
||||
mCallback->NotifyVisibility(!doc->Hidden());
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
VisibilityChangeListener::RemoveListener()
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mWindow);
|
||||
if (!window) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<EventTarget> target = do_QueryInterface(window->GetExtantDoc());
|
||||
if (target) {
|
||||
target->RemoveSystemEventListener(NS_LITERAL_STRING(kVisibilityChange),
|
||||
/* listener */ this,
|
||||
/* use capture */ true);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
VisibilityChangeListener::SetCallback(nsIContentPermissionRequestCallback *aCallback)
|
||||
{
|
||||
mCallback = aCallback;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIContentPermissionRequestCallback>
|
||||
VisibilityChangeListener::GetCallback()
|
||||
{
|
||||
nsCOMPtr<nsIContentPermissionRequestCallback> callback = mCallback;
|
||||
return callback.forget();
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
@@ -49,6 +122,7 @@ class ContentPermissionRequestParent : public PContentPermissionRequestParent
|
||||
|
||||
private:
|
||||
virtual bool Recvprompt();
|
||||
virtual bool RecvNotifyVisibility(const bool& aIsVisible);
|
||||
virtual void ActorDestroy(ActorDestroyReason why);
|
||||
};
|
||||
|
||||
@@ -79,6 +153,16 @@ ContentPermissionRequestParent::Recvprompt()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentPermissionRequestParent::RecvNotifyVisibility(const bool& aIsVisible)
|
||||
{
|
||||
if (!mProxy) {
|
||||
return false;
|
||||
}
|
||||
mProxy->NotifyVisibility(aIsVisible);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
ContentPermissionRequestParent::ActorDestroy(ActorDestroyReason why)
|
||||
{
|
||||
@@ -90,10 +174,10 @@ ContentPermissionRequestParent::ActorDestroy(ActorDestroyReason why)
|
||||
bool
|
||||
ContentPermissionRequestParent::IsBeingDestroyed()
|
||||
{
|
||||
// When TabParent::Destroy() is called, we are being destroyed. It's unsafe
|
||||
// to send out any message now.
|
||||
TabParent* tabParent = TabParent::GetFrom(Manager());
|
||||
return tabParent->IsDestroyed();
|
||||
// When ContentParent::MarkAsDead() is called, we are being destroyed.
|
||||
// It's unsafe to send out any message now.
|
||||
ContentParent* contentParent = static_cast<ContentParent*>(Manager());
|
||||
return !contentParent->IsAlive();
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(ContentPermissionType, nsIContentPermissionType)
|
||||
@@ -205,6 +289,13 @@ nsContentPermissionUtils::ConvertArrayToPermissionRequest(nsIArray* aSrcArray,
|
||||
return len;
|
||||
}
|
||||
|
||||
static std::map<PContentPermissionRequestParent*, TabId>&
|
||||
ContentPermissionRequestParentMap()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
static std::map<PContentPermissionRequestParent*, TabId> sPermissionRequestParentMap;
|
||||
return sPermissionRequestParentMap;
|
||||
}
|
||||
|
||||
/* static */ nsresult
|
||||
nsContentPermissionUtils::CreatePermissionArray(const nsACString& aType,
|
||||
@@ -225,9 +316,14 @@ nsContentPermissionUtils::CreatePermissionArray(const nsACString& aType,
|
||||
/* static */ PContentPermissionRequestParent*
|
||||
nsContentPermissionUtils::CreateContentPermissionRequestParent(const nsTArray<PermissionRequest>& aRequests,
|
||||
Element* element,
|
||||
const IPC::Principal& principal)
|
||||
const IPC::Principal& principal,
|
||||
const TabId& aTabId)
|
||||
{
|
||||
return new ContentPermissionRequestParent(aRequests, element, principal);
|
||||
PContentPermissionRequestParent* parent =
|
||||
new ContentPermissionRequestParent(aRequests, element, principal);
|
||||
ContentPermissionRequestParentMap()[parent] = aTabId;
|
||||
|
||||
return parent;
|
||||
}
|
||||
|
||||
/* static */ nsresult
|
||||
@@ -259,9 +355,11 @@ nsContentPermissionUtils::AskPermission(nsIContentPermissionRequest* aRequest, n
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
req->IPDLAddRef();
|
||||
child->SendPContentPermissionRequestConstructor(req,
|
||||
permArray,
|
||||
IPC::Principal(principal));
|
||||
ContentChild::GetSingleton()->SendPContentPermissionRequestConstructor(
|
||||
req,
|
||||
permArray,
|
||||
IPC::Principal(principal),
|
||||
child->GetTabId());
|
||||
|
||||
req->Sendprompt();
|
||||
return NS_OK;
|
||||
@@ -276,9 +374,139 @@ nsContentPermissionUtils::AskPermission(nsIContentPermissionRequest* aRequest, n
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* static */ nsTArray<PContentPermissionRequestParent*>
|
||||
nsContentPermissionUtils::GetContentPermissionRequestParentById(const TabId& aTabId)
|
||||
{
|
||||
nsTArray<PContentPermissionRequestParent*> parentArray;
|
||||
for (auto& it : ContentPermissionRequestParentMap()) {
|
||||
if (it.second == aTabId) {
|
||||
parentArray.AppendElement(it.first);
|
||||
}
|
||||
}
|
||||
|
||||
return Move(parentArray);
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
nsContentPermissionUtils::NotifyRemoveContentPermissionRequestParent(
|
||||
PContentPermissionRequestParent* aParent)
|
||||
{
|
||||
auto it = ContentPermissionRequestParentMap().find(aParent);
|
||||
MOZ_ASSERT(it != ContentPermissionRequestParentMap().end());
|
||||
|
||||
ContentPermissionRequestParentMap().erase(it);
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsContentPermissionRequester, nsIContentPermissionRequester)
|
||||
|
||||
nsContentPermissionRequester::nsContentPermissionRequester(nsPIDOMWindow* aWindow)
|
||||
: mWindow(aWindow)
|
||||
{
|
||||
mListener = new VisibilityChangeListener(mWindow);
|
||||
}
|
||||
|
||||
nsContentPermissionRequester::~nsContentPermissionRequester()
|
||||
{
|
||||
mListener->RemoveListener();
|
||||
mListener = nullptr;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsContentPermissionRequester::GetVisibility(nsIContentPermissionRequestCallback* aCallback)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCallback);
|
||||
|
||||
if (!mWindow) {
|
||||
MOZ_ASSERT(false);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShell> docshell = mWindow->GetDocShell();
|
||||
if (!docshell) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
bool isActive = false;
|
||||
docshell->GetIsActive(&isActive);
|
||||
aCallback->NotifyVisibility(isActive);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsContentPermissionRequester::SetOnVisibilityChange(nsIContentPermissionRequestCallback* aCallback)
|
||||
{
|
||||
mListener->SetCallback(aCallback);
|
||||
|
||||
if (!aCallback) {
|
||||
mListener->RemoveListener();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsContentPermissionRequester::GetOnVisibilityChange(nsIContentPermissionRequestCallback** aCallback)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCallback);
|
||||
|
||||
nsCOMPtr<nsIContentPermissionRequestCallback> callback = mListener->GetCallback();
|
||||
callback.forget(aCallback);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsContentPermissionRequestProxy::nsContentPermissionRequesterProxy,
|
||||
nsIContentPermissionRequester)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsContentPermissionRequestProxy::nsContentPermissionRequesterProxy
|
||||
::GetVisibility(nsIContentPermissionRequestCallback* aCallback)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCallback);
|
||||
|
||||
mGetCallback = aCallback;
|
||||
mWaitGettingResult = true;
|
||||
unused << mParent->SendGetVisibility();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsContentPermissionRequestProxy::nsContentPermissionRequesterProxy
|
||||
::SetOnVisibilityChange(nsIContentPermissionRequestCallback* aCallback)
|
||||
{
|
||||
mOnChangeCallback = aCallback;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsContentPermissionRequestProxy::nsContentPermissionRequesterProxy
|
||||
::GetOnVisibilityChange(nsIContentPermissionRequestCallback** aCallback)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCallback);
|
||||
|
||||
nsCOMPtr<nsIContentPermissionRequestCallback> callback = mOnChangeCallback;
|
||||
callback.forget(aCallback);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsContentPermissionRequestProxy::nsContentPermissionRequesterProxy
|
||||
::NotifyVisibilityResult(const bool& aIsVisible)
|
||||
{
|
||||
if (mWaitGettingResult) {
|
||||
MOZ_ASSERT(mGetCallback);
|
||||
mWaitGettingResult = false;
|
||||
mGetCallback->NotifyVisibility(aIsVisible);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mOnChangeCallback) {
|
||||
mOnChangeCallback->NotifyVisibility(aIsVisible);
|
||||
}
|
||||
}
|
||||
|
||||
nsContentPermissionRequestProxy::nsContentPermissionRequestProxy()
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsContentPermissionRequestProxy);
|
||||
@@ -296,6 +524,7 @@ nsContentPermissionRequestProxy::Init(const nsTArray<PermissionRequest>& request
|
||||
NS_ASSERTION(parent, "null parent");
|
||||
mParent = parent;
|
||||
mPermissionRequests = requests;
|
||||
mRequester = new nsContentPermissionRequesterProxy(mParent);
|
||||
|
||||
nsCOMPtr<nsIContentPermissionPrompt> prompt = do_GetService(NS_CONTENT_PERMISSION_PROMPT_CONTRACTID);
|
||||
if (!prompt) {
|
||||
@@ -309,6 +538,7 @@ nsContentPermissionRequestProxy::Init(const nsTArray<PermissionRequest>& request
|
||||
void
|
||||
nsContentPermissionRequestProxy::OnParentDestroyed()
|
||||
{
|
||||
mRequester = nullptr;
|
||||
mParent = nullptr;
|
||||
}
|
||||
|
||||
@@ -397,12 +627,12 @@ nsContentPermissionRequestProxy::Allow(JS::HandleValue aChoices)
|
||||
if (mPermissionRequests[i].type().EqualsLiteral("audio-capture")) {
|
||||
GonkPermissionService::GetInstance()->addGrantInfo(
|
||||
"android.permission.RECORD_AUDIO",
|
||||
TabParent::GetFrom(mParent->Manager())->Manager()->AsContentParent()->Pid());
|
||||
static_cast<ContentParent*>(mParent->Manager())->Pid());
|
||||
}
|
||||
if (mPermissionRequests[i].type().EqualsLiteral("video-capture")) {
|
||||
GonkPermissionService::GetInstance()->addGrantInfo(
|
||||
"android.permission.CAMERA",
|
||||
TabParent::GetFrom(mParent->Manager())->Manager()->AsContentParent()->Pid());
|
||||
static_cast<ContentParent*>(mParent->Manager())->Pid());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -442,9 +672,27 @@ nsContentPermissionRequestProxy::Allow(JS::HandleValue aChoices)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsContentPermissionRequestProxy::NotifyVisibility(const bool& aIsVisible)
|
||||
{
|
||||
MOZ_ASSERT(mRequester);
|
||||
|
||||
mRequester->NotifyVisibilityResult(aIsVisible);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsContentPermissionRequestProxy::GetRequester(nsIContentPermissionRequester** aRequester)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRequester);
|
||||
|
||||
nsRefPtr<nsContentPermissionRequesterProxy> requester = mRequester;
|
||||
requester.forget(aRequester);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// RemotePermissionRequest
|
||||
|
||||
NS_IMPL_ISUPPORTS0(RemotePermissionRequest)
|
||||
NS_IMPL_ISUPPORTS(RemotePermissionRequest, nsIContentPermissionRequestCallback);
|
||||
|
||||
RemotePermissionRequest::RemotePermissionRequest(
|
||||
nsIContentPermissionRequest* aRequest,
|
||||
@@ -453,6 +701,8 @@ RemotePermissionRequest::RemotePermissionRequest(
|
||||
, mWindow(aWindow)
|
||||
, mIPCOpen(false)
|
||||
{
|
||||
mListener = new VisibilityChangeListener(mWindow);
|
||||
mListener->SetCallback(this);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -474,6 +724,9 @@ bool
|
||||
RemotePermissionRequest::Recv__delete__(const bool& aAllow,
|
||||
InfallibleTArray<PermissionChoice>&& aChoices)
|
||||
{
|
||||
mListener->RemoveListener();
|
||||
mListener = nullptr;
|
||||
|
||||
if (aAllow && mWindow->IsCurrentInnerWindow()) {
|
||||
// Use 'undefined' if no choice is provided.
|
||||
if (aChoices.IsEmpty()) {
|
||||
@@ -507,3 +760,28 @@ RemotePermissionRequest::Recv__delete__(const bool& aAllow,
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
RemotePermissionRequest::RecvGetVisibility()
|
||||
{
|
||||
nsCOMPtr<nsIDocShell> docshell = mWindow->GetDocShell();
|
||||
if (!docshell) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isActive = false;
|
||||
docshell->GetIsActive(&isActive);
|
||||
unused << SendNotifyVisibility(isActive);
|
||||
return true;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
RemotePermissionRequest::NotifyVisibility(bool isVisible)
|
||||
{
|
||||
if (!mIPCOpen) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
unused << SendNotifyVisibility(isVisible);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsIMutableArray.h"
|
||||
#include "mozilla/dom/PContentPermissionRequestChild.h"
|
||||
#include "mozilla/dom/ipc/IdType.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
|
||||
// Microsoft's API Name hackery sucks
|
||||
// XXXbz Doing this in a header is a gigantic footgun. See
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=932421#c3 for why.
|
||||
@@ -27,6 +30,25 @@ namespace IPC {
|
||||
class Principal;
|
||||
} // namespace IPC
|
||||
|
||||
class VisibilityChangeListener final : public nsIDOMEventListener
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDOMEVENTLISTENER
|
||||
|
||||
explicit VisibilityChangeListener(nsPIDOMWindow* aWindow);
|
||||
|
||||
void RemoveListener();
|
||||
void SetCallback(nsIContentPermissionRequestCallback* aCallback);
|
||||
already_AddRefed<nsIContentPermissionRequestCallback> GetCallback();
|
||||
|
||||
private:
|
||||
virtual ~VisibilityChangeListener() {}
|
||||
|
||||
nsWeakPtr mWindow;
|
||||
nsCOMPtr<nsIContentPermissionRequestCallback> mCallback;
|
||||
};
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
@@ -73,44 +95,92 @@ public:
|
||||
static PContentPermissionRequestParent*
|
||||
CreateContentPermissionRequestParent(const nsTArray<PermissionRequest>& aRequests,
|
||||
Element* element,
|
||||
const IPC::Principal& principal);
|
||||
const IPC::Principal& principal,
|
||||
const TabId& aTabId);
|
||||
|
||||
static nsresult
|
||||
AskPermission(nsIContentPermissionRequest* aRequest, nsPIDOMWindow* aWindow);
|
||||
|
||||
static nsTArray<PContentPermissionRequestParent*>
|
||||
GetContentPermissionRequestParentById(const TabId& aTabId);
|
||||
|
||||
static void
|
||||
NotifyRemoveContentPermissionRequestParent(PContentPermissionRequestParent* aParent);
|
||||
};
|
||||
|
||||
class nsContentPermissionRequester final : public nsIContentPermissionRequester
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSICONTENTPERMISSIONREQUESTER
|
||||
|
||||
explicit nsContentPermissionRequester(nsPIDOMWindow* aWindow);
|
||||
|
||||
private:
|
||||
virtual ~nsContentPermissionRequester();
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> mWindow;
|
||||
nsRefPtr<VisibilityChangeListener> mListener;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
using mozilla::dom::ContentPermissionRequestParent;
|
||||
|
||||
class nsContentPermissionRequestProxy : public nsIContentPermissionRequest
|
||||
{
|
||||
public:
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSICONTENTPERMISSIONREQUEST
|
||||
|
||||
nsContentPermissionRequestProxy();
|
||||
|
||||
nsresult Init(const nsTArray<mozilla::dom::PermissionRequest>& requests,
|
||||
mozilla::dom::ContentPermissionRequestParent* parent);
|
||||
ContentPermissionRequestParent* parent);
|
||||
|
||||
void OnParentDestroyed();
|
||||
|
||||
private:
|
||||
void NotifyVisibility(const bool& aIsVisible);
|
||||
|
||||
private:
|
||||
class nsContentPermissionRequesterProxy final : public nsIContentPermissionRequester {
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSICONTENTPERMISSIONREQUESTER
|
||||
|
||||
explicit nsContentPermissionRequesterProxy(ContentPermissionRequestParent* aParent)
|
||||
: mParent(aParent)
|
||||
, mWaitGettingResult(false) {}
|
||||
|
||||
void NotifyVisibilityResult(const bool& aIsVisible);
|
||||
|
||||
private:
|
||||
virtual ~nsContentPermissionRequesterProxy() {}
|
||||
|
||||
ContentPermissionRequestParent* mParent;
|
||||
bool mWaitGettingResult;
|
||||
nsCOMPtr<nsIContentPermissionRequestCallback> mGetCallback;
|
||||
nsCOMPtr<nsIContentPermissionRequestCallback> mOnChangeCallback;
|
||||
};
|
||||
|
||||
virtual ~nsContentPermissionRequestProxy();
|
||||
|
||||
// Non-owning pointer to the ContentPermissionRequestParent object which owns this proxy.
|
||||
mozilla::dom::ContentPermissionRequestParent* mParent;
|
||||
ContentPermissionRequestParent* mParent;
|
||||
nsTArray<mozilla::dom::PermissionRequest> mPermissionRequests;
|
||||
nsRefPtr<nsContentPermissionRequesterProxy> mRequester;
|
||||
};
|
||||
|
||||
/**
|
||||
* RemotePermissionRequest will send a prompt ipdl request to b2g process.
|
||||
*/
|
||||
class RemotePermissionRequest final : public nsISupports
|
||||
class RemotePermissionRequest final : public nsIContentPermissionRequestCallback
|
||||
, public mozilla::dom::PContentPermissionRequestChild
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSICONTENTPERMISSIONREQUESTCALLBACK
|
||||
|
||||
RemotePermissionRequest(nsIContentPermissionRequest* aRequest,
|
||||
nsPIDOMWindow* aWindow);
|
||||
@@ -119,6 +189,8 @@ public:
|
||||
virtual bool Recv__delete__(const bool &aAllow,
|
||||
InfallibleTArray<PermissionChoice>&& aChoices) override;
|
||||
|
||||
virtual bool RecvGetVisibility() override;
|
||||
|
||||
void IPDLAddRef()
|
||||
{
|
||||
mIPCOpen = true;
|
||||
@@ -143,6 +215,7 @@ private:
|
||||
nsCOMPtr<nsIContentPermissionRequest> mRequest;
|
||||
nsCOMPtr<nsPIDOMWindow> mWindow;
|
||||
bool mIPCOpen;
|
||||
nsRefPtr<VisibilityChangeListener> mListener;
|
||||
};
|
||||
|
||||
#endif // nsContentPermissionHelper_h
|
||||
|
||||
+27
-5
@@ -10846,8 +10846,8 @@ nsIDocument::Children()
|
||||
{
|
||||
if (!mChildrenCollection) {
|
||||
mChildrenCollection = new nsContentList(this, kNameSpaceID_Wildcard,
|
||||
nsGkAtoms::_asterix,
|
||||
nsGkAtoms::_asterix,
|
||||
nsGkAtoms::_asterisk,
|
||||
nsGkAtoms::_asterisk,
|
||||
false);
|
||||
}
|
||||
|
||||
@@ -12015,6 +12015,8 @@ DispatchPointerLockError(nsIDocument* aTarget)
|
||||
asyncDispatcher->PostDOMEvent();
|
||||
}
|
||||
|
||||
static const uint8_t kPointerLockRequestLimit = 2;
|
||||
|
||||
mozilla::StaticRefPtr<nsPointerLockPermissionRequest> gPendingPointerLockRequest;
|
||||
|
||||
class nsPointerLockPermissionRequest : public nsRunnable,
|
||||
@@ -12024,7 +12026,13 @@ public:
|
||||
nsPointerLockPermissionRequest(Element* aElement, bool aUserInputOrChromeCaller)
|
||||
: mElement(do_GetWeakReference(aElement)),
|
||||
mDocument(do_GetWeakReference(aElement->OwnerDoc())),
|
||||
mUserInputOrChromeCaller(aUserInputOrChromeCaller) {}
|
||||
mUserInputOrChromeCaller(aUserInputOrChromeCaller)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);
|
||||
if (doc) {
|
||||
mRequester = new nsContentPermissionRequester(doc->GetInnerWindow());
|
||||
}
|
||||
}
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSICONTENTPERMISSIONREQUEST
|
||||
@@ -12056,7 +12064,7 @@ public:
|
||||
// In non-fullscreen mode user input (or chrome caller) is required!
|
||||
// Also, don't let the page to try to get the permission too many times.
|
||||
if (!mUserInputOrChromeCaller ||
|
||||
doc->mCancelledPointerLockRequests > 2) {
|
||||
doc->mCancelledPointerLockRequests > kPointerLockRequestLimit) {
|
||||
Handled();
|
||||
DispatchPointerLockError(d);
|
||||
return NS_OK;
|
||||
@@ -12084,6 +12092,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual ~nsPointerLockPermissionRequest() {}
|
||||
nsCOMPtr<nsIContentPermissionRequester> mRequester;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED(nsPointerLockPermissionRequest,
|
||||
@@ -12134,7 +12143,10 @@ nsPointerLockPermissionRequest::Cancel()
|
||||
nsCOMPtr<nsIDocument> d = do_QueryReferent(mDocument);
|
||||
Handled();
|
||||
if (d) {
|
||||
static_cast<nsDocument*>(d.get())->mCancelledPointerLockRequests++;
|
||||
auto doc = static_cast<nsDocument*>(d.get());
|
||||
if (doc->mCancelledPointerLockRequests <= kPointerLockRequestLimit) {
|
||||
doc->mCancelledPointerLockRequests++;
|
||||
}
|
||||
DispatchPointerLockError(d);
|
||||
}
|
||||
return NS_OK;
|
||||
@@ -12189,6 +12201,16 @@ nsPointerLockPermissionRequest::Allow(JS::HandleValue aChoices)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPointerLockPermissionRequest::GetRequester(nsIContentPermissionRequester** aRequester)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRequester);
|
||||
|
||||
nsCOMPtr<nsIContentPermissionRequester> requester = mRequester;
|
||||
requester.forget(aRequester);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsDocument::SetApprovedForFullscreen(bool aIsApproved)
|
||||
{
|
||||
|
||||
@@ -1670,7 +1670,9 @@ public:
|
||||
// 'style-sheet-applicable-state-changed' notification.
|
||||
bool mSSApplicableStateNotificationPending:1;
|
||||
|
||||
uint32_t mCancelledPointerLockRequests;
|
||||
// The number of pointer lock requests which are cancelled by the user.
|
||||
// The value is saturated to kPointerLockRequestLimit+1 = 3.
|
||||
uint8_t mCancelledPointerLockRequests:2;
|
||||
|
||||
uint8_t mXMLDeclarationBits;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ GK_ATOM(_moz_original_size, "_moz_original_size")
|
||||
GK_ATOM(_moz_target, "_moz_target")
|
||||
GK_ATOM(menuactive, "_moz-menuactive")
|
||||
GK_ATOM(_poundDefault, "#default")
|
||||
GK_ATOM(_asterix, "*")
|
||||
GK_ATOM(_asterisk, "*")
|
||||
GK_ATOM(a, "a")
|
||||
GK_ATOM(abbr, "abbr")
|
||||
GK_ATOM(abort, "abort")
|
||||
|
||||
@@ -152,6 +152,7 @@ public:
|
||||
, mCameraId(aCameraId)
|
||||
, mInitialConfig(aInitialConfig)
|
||||
, mPromise(aPromise)
|
||||
, mRequester(new nsContentPermissionRequester(mWindow))
|
||||
{ }
|
||||
|
||||
protected:
|
||||
@@ -166,6 +167,7 @@ protected:
|
||||
uint32_t mCameraId;
|
||||
CameraConfiguration mInitialConfig;
|
||||
nsRefPtr<Promise> mPromise;
|
||||
nsCOMPtr<nsIContentPermissionRequester> mRequester;
|
||||
};
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION(CameraPermissionRequest, mWindow, mPromise)
|
||||
@@ -219,6 +221,16 @@ CameraPermissionRequest::Allow(JS::HandleValue aChoices)
|
||||
return DispatchCallback(nsIPermissionManager::ALLOW_ACTION);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
CameraPermissionRequest::GetRequester(nsIContentPermissionRequester** aRequester)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRequester);
|
||||
|
||||
nsCOMPtr<nsIContentPermissionRequester> requester = mRequester;
|
||||
requester.forget(aRequester);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
CameraPermissionRequest::DispatchCallback(uint32_t aPermission)
|
||||
{
|
||||
|
||||
@@ -299,7 +299,7 @@ CanvasImageCache::Lookup(Element* aImage,
|
||||
|
||||
gImageCache->MarkUsed(entry->mData);
|
||||
|
||||
*aSize = gfx::ToIntSize(entry->mData->mSize);
|
||||
*aSize = entry->mData->mSize;
|
||||
return entry->mData->mSourceSurface;
|
||||
}
|
||||
|
||||
|
||||
@@ -4427,7 +4427,7 @@ CanvasRenderingContext2D::DrawImage(const HTMLImageOrCanvasOrVideoElement& image
|
||||
return;
|
||||
}
|
||||
|
||||
imgSize = gfx::ToIntSize(res.mSize);
|
||||
imgSize = res.mSize;
|
||||
|
||||
// Scale sw/sh based on aspect ratio
|
||||
if (image.IsHTMLVideoElement()) {
|
||||
|
||||
@@ -2175,6 +2175,7 @@ nsDOMDeviceStorageCursor::nsDOMDeviceStorageCursor(nsPIDOMWindow* aWindow,
|
||||
, mSince(aSince)
|
||||
, mFile(aFile)
|
||||
, mPrincipal(aPrincipal)
|
||||
, mRequester(new nsContentPermissionRequester(GetOwner()))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2264,6 +2265,16 @@ nsDOMDeviceStorageCursor::Allow(JS::HandleValue aChoices)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMDeviceStorageCursor::GetRequester(nsIContentPermissionRequester** aRequester)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRequester);
|
||||
|
||||
nsCOMPtr<nsIContentPermissionRequester> requester = mRequester;
|
||||
requester.forget(aRequester);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMDeviceStorageCursor::Continue(ErrorResult& aRv)
|
||||
{
|
||||
@@ -2850,6 +2861,7 @@ public:
|
||||
, mFile(aFile)
|
||||
, mRequest(aRequest)
|
||||
, mDeviceStorage(aDeviceStorage)
|
||||
, mRequester(new nsContentPermissionRequester(mWindow))
|
||||
{
|
||||
MOZ_ASSERT(mWindow);
|
||||
MOZ_ASSERT(mPrincipal);
|
||||
@@ -2870,6 +2882,7 @@ public:
|
||||
, mFile(aFile)
|
||||
, mRequest(aRequest)
|
||||
, mBlob(aBlob)
|
||||
, mRequester(new nsContentPermissionRequester(mWindow))
|
||||
{
|
||||
MOZ_ASSERT(mWindow);
|
||||
MOZ_ASSERT(mPrincipal);
|
||||
@@ -2889,6 +2902,7 @@ public:
|
||||
, mFile(aFile)
|
||||
, mRequest(aRequest)
|
||||
, mDSFileDescriptor(aDSFileDescriptor)
|
||||
, mRequester(new nsContentPermissionRequester(mWindow))
|
||||
{
|
||||
MOZ_ASSERT(mRequestType == DEVICE_STORAGE_REQUEST_CREATEFD);
|
||||
MOZ_ASSERT(mWindow);
|
||||
@@ -3298,6 +3312,15 @@ public:
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP GetRequester(nsIContentPermissionRequester** aRequester)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRequester);
|
||||
|
||||
nsCOMPtr<nsIContentPermissionRequester> requester = mRequester;
|
||||
requester.forget(aRequester);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
~DeviceStorageRequest() {}
|
||||
|
||||
@@ -3310,6 +3333,7 @@ private:
|
||||
nsCOMPtr<nsIDOMBlob> mBlob;
|
||||
nsRefPtr<nsDOMDeviceStorage> mDeviceStorage;
|
||||
nsRefPtr<DeviceStorageFileDescriptor> mDSFileDescriptor;
|
||||
nsCOMPtr<nsIContentPermissionRequester> mRequester;
|
||||
};
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DeviceStorageRequest)
|
||||
|
||||
@@ -220,6 +220,7 @@ private:
|
||||
|
||||
nsRefPtr<DeviceStorageFile> mFile;
|
||||
nsCOMPtr<nsIPrincipal> mPrincipal;
|
||||
nsCOMPtr<nsIContentPermissionRequester> mRequester;
|
||||
};
|
||||
|
||||
//helpers
|
||||
|
||||
@@ -11,12 +11,11 @@
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "nsCoord.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsPoint.h"
|
||||
|
||||
class nsIScrollableFrame;
|
||||
class nsITimer;
|
||||
|
||||
struct nsIntPoint;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class EventStateManager;
|
||||
|
||||
@@ -55,6 +55,7 @@ FileSystemPermissionRequest::FileSystemPermissionRequest(
|
||||
}
|
||||
|
||||
mPrincipal = doc->NodePrincipal();
|
||||
mRequester = new nsContentPermissionRequester(mWindow);
|
||||
}
|
||||
|
||||
FileSystemPermissionRequest::~FileSystemPermissionRequest()
|
||||
@@ -135,5 +136,15 @@ FileSystemPermissionRequest::Run()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
FileSystemPermissionRequest::GetRequester(nsIContentPermissionRequester** aRequester)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRequester);
|
||||
|
||||
nsCOMPtr<nsIContentPermissionRequester> requester = mRequester;
|
||||
requester.forget(aRequester);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} /* namespace dom */
|
||||
} /* namespace mozilla */
|
||||
|
||||
@@ -42,6 +42,7 @@ private:
|
||||
nsRefPtr<FileSystemTaskBase> mTask;
|
||||
nsCOMPtr<nsPIDOMWindow> mWindow;
|
||||
nsCOMPtr<nsIPrincipal> mPrincipal;
|
||||
nsCOMPtr<nsIContentPermissionRequester> mRequester;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
||||
@@ -110,6 +110,7 @@ class nsGeolocationRequest final
|
||||
|
||||
int32_t mWatchId;
|
||||
bool mShutdown;
|
||||
nsCOMPtr<nsIContentPermissionRequester> mRequester;
|
||||
};
|
||||
|
||||
static PositionOptions*
|
||||
@@ -355,6 +356,13 @@ nsGeolocationRequest::nsGeolocationRequest(Geolocation* aLocator,
|
||||
mWatchId(aWatchId),
|
||||
mShutdown(false)
|
||||
{
|
||||
nsCOMPtr<nsIDOMWindow> win = do_QueryReferent(mLocator->GetOwner());
|
||||
if (win) {
|
||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(win);
|
||||
if (window) {
|
||||
mRequester = new nsContentPermissionRequester(window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nsGeolocationRequest::~nsGeolocationRequest()
|
||||
@@ -499,6 +507,16 @@ nsGeolocationRequest::Allow(JS::HandleValue aChoices)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGeolocationRequest::GetRequester(nsIContentPermissionRequester** aRequester)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRequester);
|
||||
|
||||
nsCOMPtr<nsIContentPermissionRequester> requester = mRequester;
|
||||
requester.forget(aRequester);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsGeolocationRequest::SetTimeoutTimer()
|
||||
{
|
||||
|
||||
@@ -32,12 +32,40 @@ interface nsIContentPermissionType : nsISupports {
|
||||
readonly attribute nsIArray options; // ["choice1", "choice2"]
|
||||
};
|
||||
|
||||
/**
|
||||
* Interface provides the callback type.
|
||||
*/
|
||||
[scriptable, uuid(5fb5bb60-7069-11e4-9803-0800200c9a66)]
|
||||
interface nsIContentPermissionRequestCallback : nsISupports {
|
||||
/**
|
||||
* The callback of the visibility result.
|
||||
*/
|
||||
void notifyVisibility(in boolean isVisible);
|
||||
};
|
||||
|
||||
/**
|
||||
* Interface provides the way to get the visibility and
|
||||
* the notification.
|
||||
*/
|
||||
[scriptable, uuid(f8577124-6a5f-486f-ae04-c5bcae911eb5)]
|
||||
interface nsIContentPermissionRequester : nsISupports {
|
||||
/**
|
||||
* The function to get the visibility.
|
||||
*/
|
||||
void getVisibility(in nsIContentPermissionRequestCallback callback);
|
||||
|
||||
/**
|
||||
* The callback to get the notification of visibility change.
|
||||
*/
|
||||
attribute nsIContentPermissionRequestCallback onVisibilityChange;
|
||||
};
|
||||
|
||||
/**
|
||||
* Interface allows access to a content to request
|
||||
* permission to perform a privileged operation such as
|
||||
* geolocation.
|
||||
*/
|
||||
[scriptable, uuid(69a39d88-d1c4-4ba9-9b19-bafc7a1bb783)]
|
||||
[scriptable, uuid(408c8fcd-1420-4aff-94d8-39bf74d79219)]
|
||||
interface nsIContentPermissionRequest : nsISupports {
|
||||
/**
|
||||
* The array will include the request types. Elements of this array are
|
||||
@@ -59,6 +87,12 @@ interface nsIContentPermissionRequest : nsISupports {
|
||||
readonly attribute nsIDOMWindow window;
|
||||
readonly attribute nsIDOMElement element;
|
||||
|
||||
/**
|
||||
* The requester to get the required information of
|
||||
* the window.
|
||||
*/
|
||||
readonly attribute nsIContentPermissionRequester requester;
|
||||
|
||||
/**
|
||||
* allow or cancel the request
|
||||
*/
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
#include "nsISystemMessageCache.h"
|
||||
#include "nsDirectoryServiceUtils.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsContentPermissionHelper.h"
|
||||
|
||||
#include "IHistory.h"
|
||||
#include "nsNetUtil.h"
|
||||
@@ -2749,6 +2750,23 @@ ContentChild::RecvUpdateWindow(const uintptr_t& aChildId)
|
||||
#endif
|
||||
}
|
||||
|
||||
PContentPermissionRequestChild*
|
||||
ContentChild::AllocPContentPermissionRequestChild(const InfallibleTArray<PermissionRequest>& aRequests,
|
||||
const IPC::Principal& aPrincipal,
|
||||
const TabId& aTabId)
|
||||
{
|
||||
NS_RUNTIMEABORT("unused");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
ContentChild::DeallocPContentPermissionRequestChild(PContentPermissionRequestChild* actor)
|
||||
{
|
||||
auto child = static_cast<RemotePermissionRequest*>(actor);
|
||||
child->IPDLRelease();
|
||||
return true;
|
||||
}
|
||||
|
||||
// This code goes here rather than nsGlobalWindow.cpp because nsGlobalWindow.cpp
|
||||
// can't include ContentChild.h since it includes windows.h.
|
||||
|
||||
|
||||
@@ -449,6 +449,13 @@ public:
|
||||
virtual bool
|
||||
DeallocPOfflineCacheUpdateChild(POfflineCacheUpdateChild* offlineCacheUpdate) override;
|
||||
|
||||
virtual PContentPermissionRequestChild*
|
||||
AllocPContentPermissionRequestChild(const InfallibleTArray<PermissionRequest>& aRequests,
|
||||
const IPC::Principal& aPrincipal,
|
||||
const TabId& aTabId) override;
|
||||
virtual bool
|
||||
DeallocPContentPermissionRequestChild(PContentPermissionRequestChild* actor) override;
|
||||
|
||||
private:
|
||||
virtual void ActorDestroy(ActorDestroyReason why) override;
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "mozilla/dom/FileSystemRequestParent.h"
|
||||
#include "mozilla/dom/GeolocationBinding.h"
|
||||
#include "mozilla/dom/PContentBridgeParent.h"
|
||||
#include "mozilla/dom/PContentPermissionRequestParent.h"
|
||||
#include "mozilla/dom/PCycleCollectWithLogsParent.h"
|
||||
#include "mozilla/dom/PFMRadioParent.h"
|
||||
#include "mozilla/dom/PMemoryReportRequestParent.h"
|
||||
@@ -98,6 +99,7 @@
|
||||
#include "nsIAlertsService.h"
|
||||
#include "nsIAppsService.h"
|
||||
#include "nsIClipboard.h"
|
||||
#include "nsContentPermissionHelper.h"
|
||||
#include "nsICycleCollectorListener.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMGeoGeolocation.h"
|
||||
@@ -2007,6 +2009,18 @@ ContentParent::NotifyTabDestroyed(PBrowserParent* aTab,
|
||||
--mNumDestroyingTabs;
|
||||
}
|
||||
|
||||
TabId id = static_cast<TabParent*>(aTab)->GetTabId();
|
||||
nsTArray<PContentPermissionRequestParent*> parentArray =
|
||||
nsContentPermissionUtils::GetContentPermissionRequestParentById(id);
|
||||
|
||||
// Need to close undeleted ContentPermissionRequestParents before tab is closed.
|
||||
for (auto& permissionRequestParent : parentArray) {
|
||||
nsTArray<PermissionChoice> emptyChoices;
|
||||
unused << PContentPermissionRequestParent::Send__delete__(permissionRequestParent,
|
||||
false,
|
||||
emptyChoices);
|
||||
}
|
||||
|
||||
// There can be more than one PBrowser for a given app process
|
||||
// because of popup windows. When the last one closes, shut
|
||||
// us down.
|
||||
@@ -4732,6 +4746,32 @@ ContentParent::RecvUpdateDropEffect(const uint32_t& aDragAction,
|
||||
return true;
|
||||
}
|
||||
|
||||
PContentPermissionRequestParent*
|
||||
ContentParent::AllocPContentPermissionRequestParent(const InfallibleTArray<PermissionRequest>& aRequests,
|
||||
const IPC::Principal& aPrincipal,
|
||||
const TabId& aTabId)
|
||||
{
|
||||
ContentProcessManager* cpm = ContentProcessManager::GetSingleton();
|
||||
nsRefPtr<TabParent> tp = cpm->GetTopLevelTabParentByProcessAndTabId(this->ChildID(),
|
||||
aTabId);
|
||||
if (!tp) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return nsContentPermissionUtils::CreateContentPermissionRequestParent(aRequests,
|
||||
tp->GetOwnerElement(),
|
||||
aPrincipal,
|
||||
aTabId);
|
||||
}
|
||||
|
||||
bool
|
||||
ContentParent::DeallocPContentPermissionRequestParent(PContentPermissionRequestParent* actor)
|
||||
{
|
||||
nsContentPermissionUtils::NotifyRemoveContentPermissionRequestParent(actor);
|
||||
delete actor;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
|
||||
@@ -361,6 +361,14 @@ public:
|
||||
virtual bool RecvFinishShutdown() override;
|
||||
|
||||
void MaybeInvokeDragSession(TabParent* aParent);
|
||||
|
||||
virtual PContentPermissionRequestParent*
|
||||
AllocPContentPermissionRequestParent(const InfallibleTArray<PermissionRequest>& aRequests,
|
||||
const IPC::Principal& aPrincipal,
|
||||
const TabId& aTabId) override;
|
||||
virtual bool
|
||||
DeallocPContentPermissionRequestParent(PContentPermissionRequestParent* actor) override;
|
||||
|
||||
protected:
|
||||
void OnChannelConnected(int32_t pid) override;
|
||||
virtual void ActorDestroy(ActorDestroyReason why) override;
|
||||
|
||||
+6
-24
@@ -10,7 +10,6 @@ include protocol PColorPicker;
|
||||
include protocol PContent;
|
||||
include protocol PContentBridge;
|
||||
include protocol PDocumentRenderer;
|
||||
include protocol PContentPermissionRequest;
|
||||
include protocol PFilePicker;
|
||||
include protocol PIndexedDBPermissionRequest;
|
||||
include protocol PRenderFrame;
|
||||
@@ -18,7 +17,6 @@ include protocol PPluginWidget;
|
||||
include DOMTypes;
|
||||
include JavaScriptTypes;
|
||||
include URIParams;
|
||||
include PContentPermission;
|
||||
include ServiceWorkerRegistrarTypes;
|
||||
|
||||
|
||||
@@ -39,9 +37,9 @@ using nscolor from "nsColor.h";
|
||||
using class mozilla::WidgetCompositionEvent from "ipc/nsGUIEventIPC.h";
|
||||
using struct mozilla::widget::IMENotification from "nsIWidget.h";
|
||||
using struct nsIMEUpdatePreference from "nsIWidget.h";
|
||||
using struct nsIntPoint from "nsPoint.h";
|
||||
using struct nsIntRect from "nsRect.h";
|
||||
using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
|
||||
using mozilla::gfx::IntPoint from "mozilla/gfx/Point.h";
|
||||
using mozilla::gfx::IntRect from "mozilla/gfx/Rect.h";
|
||||
using class mozilla::WidgetKeyboardEvent from "ipc/nsGUIEventIPC.h";
|
||||
using class mozilla::WidgetMouseEvent from "ipc/nsGUIEventIPC.h";
|
||||
using class mozilla::WidgetWheelEvent from "ipc/nsGUIEventIPC.h";
|
||||
@@ -103,7 +101,6 @@ prio(normal upto urgent) sync protocol PBrowser
|
||||
|
||||
manages PColorPicker;
|
||||
manages PDocumentRenderer;
|
||||
manages PContentPermissionRequest;
|
||||
manages PFilePicker;
|
||||
manages PIndexedDBPermissionRequest;
|
||||
manages PRenderFrame;
|
||||
@@ -384,21 +381,6 @@ parent:
|
||||
*/
|
||||
PColorPicker(nsString title, nsString initialColor);
|
||||
|
||||
/**
|
||||
* Initiates an asynchronous request for permission for the
|
||||
* provided principal.
|
||||
*
|
||||
* @param aRequests
|
||||
* The array of permissions to request.
|
||||
* @param aPrincipal
|
||||
* The principal of the request.
|
||||
*
|
||||
* NOTE: The principal is untrusted in the parent process. Only
|
||||
* principals that can live in the content process should
|
||||
* provided.
|
||||
*/
|
||||
PContentPermissionRequest(PermissionRequest[] aRequests, Principal aPrincipal);
|
||||
|
||||
PFilePicker(nsString aTitle, int16_t aMode);
|
||||
|
||||
/**
|
||||
@@ -506,11 +488,11 @@ parent:
|
||||
uint64_t aObserverId);
|
||||
SynthesizeNativeTouchPoint(uint32_t aPointerId,
|
||||
TouchPointerState aPointerState,
|
||||
nsIntPoint aPointerScreenPoint,
|
||||
IntPoint aPointerScreenPoint,
|
||||
double aPointerPressure,
|
||||
uint32_t aPointerOrientation,
|
||||
uint64_t aObserverId);
|
||||
SynthesizeNativeTouchTap(nsIntPoint aPointerScreenPoint,
|
||||
SynthesizeNativeTouchTap(IntPoint aPointerScreenPoint,
|
||||
bool aLongTap,
|
||||
uint64_t aObserverId);
|
||||
ClearNativeTouchSequence(uint64_t aObserverId);
|
||||
@@ -566,8 +548,8 @@ child:
|
||||
|
||||
CacheFileDescriptor(nsString path, FileDescriptor fd);
|
||||
|
||||
UpdateDimensions(nsIntRect rect, ScreenIntSize size, ScreenOrientation orientation,
|
||||
nsIntPoint chromeDisp) compress;
|
||||
UpdateDimensions(IntRect rect, ScreenIntSize size, ScreenOrientation orientation,
|
||||
LayoutDeviceIntPoint chromeDisp) compress;
|
||||
|
||||
UpdateFrame(FrameMetrics frame);
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ include protocol PBrowser;
|
||||
include protocol PCellBroadcast;
|
||||
include protocol PCompositor;
|
||||
include protocol PContentBridge;
|
||||
include protocol PContentPermissionRequest;
|
||||
include protocol PCycleCollectWithLogs;
|
||||
include protocol PDocAccessible;
|
||||
include protocol PPSMContentDownloader;
|
||||
@@ -54,6 +55,7 @@ include PTabContext;
|
||||
include URIParams;
|
||||
include PluginTypes;
|
||||
include ProtocolTypes;
|
||||
include PContentPermission;
|
||||
|
||||
// Workaround to prevent error if PContentChild.cpp & PContentBridgeParent.cpp
|
||||
// are put into different UnifiedProtocolsXX.cpp files.
|
||||
@@ -379,6 +381,7 @@ prio(normal upto urgent) sync protocol PContent
|
||||
manages PBluetooth;
|
||||
manages PBrowser;
|
||||
manages PCellBroadcast;
|
||||
manages PContentPermissionRequest;
|
||||
manages PCycleCollectWithLogs;
|
||||
manages PDocAccessible;
|
||||
manages PDeviceStorageRequest;
|
||||
@@ -949,6 +952,25 @@ parent:
|
||||
async FinishShutdown();
|
||||
|
||||
UpdateDropEffect(uint32_t aDragAction, uint32_t aDropEffect);
|
||||
|
||||
/**
|
||||
* Initiates an asynchronous request for permission for the
|
||||
* provided principal.
|
||||
*
|
||||
* @param aRequests
|
||||
* The array of permissions to request.
|
||||
* @param aPrincipal
|
||||
* The principal of the request.
|
||||
* @param tabId
|
||||
* To identify which tab issues this request.
|
||||
*
|
||||
* NOTE: The principal is untrusted in the parent process. Only
|
||||
* principals that can live in the content process should
|
||||
* provided.
|
||||
*/
|
||||
PContentPermissionRequest(PermissionRequest[] aRequests, Principal aPrincipal,
|
||||
TabId tabId);
|
||||
|
||||
both:
|
||||
AsyncMessage(nsString aMessage, ClonedMessageData aData,
|
||||
CpowEntry[] aCpows, Principal aPrincipal);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 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 protocol PBrowser;
|
||||
include protocol PContent;
|
||||
include PContentPermission;
|
||||
|
||||
namespace mozilla {
|
||||
@@ -10,12 +10,14 @@ namespace dom {
|
||||
|
||||
protocol PContentPermissionRequest
|
||||
{
|
||||
manager PBrowser;
|
||||
manager PContent;
|
||||
|
||||
parent:
|
||||
prompt();
|
||||
NotifyVisibility(bool visibility);
|
||||
|
||||
child:
|
||||
GetVisibility();
|
||||
__delete__(bool allow, PermissionChoice[] choices);
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ include protocol PBrowser;
|
||||
|
||||
include "mozilla/GfxMessageUtils.h";
|
||||
|
||||
using struct nsIntRect from "nsRect.h";
|
||||
using nsIntRect from "nsRect.h";
|
||||
|
||||
namespace mozilla {
|
||||
namespace plugins {
|
||||
|
||||
@@ -8,7 +8,7 @@ include protocol PContent;
|
||||
|
||||
include "mozilla/GfxMessageUtils.h";
|
||||
|
||||
using struct nsIntRect from "nsRect.h";
|
||||
using nsIntRect from "nsRect.h";
|
||||
using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
+3
-20
@@ -68,7 +68,6 @@
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsWindowWatcher.h"
|
||||
#include "PermissionMessageUtils.h"
|
||||
#include "nsContentPermissionHelper.h"
|
||||
#include "PuppetWidget.h"
|
||||
#include "StructuredCloneUtils.h"
|
||||
#include "nsViewportInfo.h"
|
||||
@@ -1076,7 +1075,7 @@ TabChild::Init()
|
||||
}
|
||||
mWidget->Create(
|
||||
nullptr, 0, // no parents
|
||||
nsIntRect(nsIntPoint(0, 0), nsIntSize(0, 0)),
|
||||
gfx::IntRect(gfx::IntPoint(0, 0), gfx::IntSize(0, 0)),
|
||||
nullptr // HandleWidgetEvent
|
||||
);
|
||||
|
||||
@@ -2001,7 +2000,7 @@ TabChild::RecvShow(const ScreenIntSize& aSize,
|
||||
|
||||
bool
|
||||
TabChild::RecvUpdateDimensions(const nsIntRect& rect, const ScreenIntSize& size,
|
||||
const ScreenOrientation& orientation, const nsIntPoint& chromeDisp)
|
||||
const ScreenOrientation& orientation, const LayoutDeviceIntPoint& chromeDisp)
|
||||
{
|
||||
if (!mRemoteFrame) {
|
||||
return true;
|
||||
@@ -2612,22 +2611,6 @@ TabChild::DeallocPColorPickerChild(PColorPickerChild* aColorPicker)
|
||||
return true;
|
||||
}
|
||||
|
||||
PContentPermissionRequestChild*
|
||||
TabChild::AllocPContentPermissionRequestChild(const InfallibleTArray<PermissionRequest>& aRequests,
|
||||
const IPC::Principal& aPrincipal)
|
||||
{
|
||||
NS_RUNTIMEABORT("unused");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::DeallocPContentPermissionRequestChild(PContentPermissionRequestChild* actor)
|
||||
{
|
||||
RemotePermissionRequest* child = static_cast<RemotePermissionRequest*>(actor);
|
||||
child->IPDLRelease();
|
||||
return true;
|
||||
}
|
||||
|
||||
PFilePickerChild*
|
||||
TabChild::AllocPFilePickerChild(const nsString&, const int16_t&)
|
||||
{
|
||||
@@ -3190,7 +3173,7 @@ TabChild::CreatePluginWidget(nsIWidget* aParent, nsIWidget** aOut)
|
||||
initData.mUnicode = false;
|
||||
initData.clipChildren = true;
|
||||
initData.clipSiblings = true;
|
||||
nsresult rv = pluginWidget->Create(aParent, nullptr, nsIntRect(nsIntPoint(0, 0),
|
||||
nsresult rv = pluginWidget->Create(aParent, nullptr, gfx::IntRect(gfx::IntPoint(0, 0),
|
||||
nsIntSize(0, 0)), &initData);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Creating native plugin widget on the chrome side failed.");
|
||||
|
||||
+3
-9
@@ -320,7 +320,7 @@ public:
|
||||
virtual bool RecvUpdateDimensions(const nsIntRect& rect,
|
||||
const ScreenIntSize& size,
|
||||
const ScreenOrientation& orientation,
|
||||
const nsIntPoint& chromeDisp) override;
|
||||
const LayoutDeviceIntPoint& chromeDisp) override;
|
||||
virtual bool RecvUpdateFrame(const layers::FrameMetrics& aFrameMetrics) override;
|
||||
virtual bool RecvRequestFlingSnap(const ViewID& aScrollId,
|
||||
const CSSPoint& aDestination) override;
|
||||
@@ -406,12 +406,6 @@ public:
|
||||
AllocPColorPickerChild(const nsString& title, const nsString& initialColor) override;
|
||||
virtual bool DeallocPColorPickerChild(PColorPickerChild* actor) override;
|
||||
|
||||
virtual PContentPermissionRequestChild*
|
||||
AllocPContentPermissionRequestChild(const InfallibleTArray<PermissionRequest>& aRequests,
|
||||
const IPC::Principal& aPrincipal) override;
|
||||
virtual bool
|
||||
DeallocPContentPermissionRequestChild(PContentPermissionRequestChild* actor) override;
|
||||
|
||||
virtual PFilePickerChild*
|
||||
AllocPFilePickerChild(const nsString& aTitle, const int16_t& aMode) override;
|
||||
virtual bool
|
||||
@@ -494,7 +488,7 @@ public:
|
||||
bool DeallocPPluginWidgetChild(PPluginWidgetChild* aActor) override;
|
||||
nsresult CreatePluginWidget(nsIWidget* aParent, nsIWidget** aOut);
|
||||
|
||||
nsIntPoint GetChromeDisplacement() { return mChromeDisp; };
|
||||
LayoutDeviceIntPoint GetChromeDisplacement() { return mChromeDisp; };
|
||||
|
||||
bool ParentIsActive()
|
||||
{
|
||||
@@ -633,7 +627,7 @@ private:
|
||||
bool mHasValidInnerSize;
|
||||
bool mDestroyed;
|
||||
// Position of tab, relative to parent widget (typically the window)
|
||||
nsIntPoint mChromeDisp;
|
||||
LayoutDeviceIntPoint mChromeDisp;
|
||||
TabId mUniqueId;
|
||||
float mDPI;
|
||||
double mDefaultScale;
|
||||
|
||||
+1
-18
@@ -13,7 +13,6 @@
|
||||
#include "mozilla/BrowserElementParent.h"
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "mozilla/dom/DataTransfer.h"
|
||||
#include "mozilla/dom/PContentPermissionRequestParent.h"
|
||||
#include "mozilla/dom/ServiceWorkerRegistrar.h"
|
||||
#include "mozilla/dom/indexedDB/ActorsParent.h"
|
||||
#include "mozilla/plugins/PluginWidgetParent.h"
|
||||
@@ -34,7 +33,6 @@
|
||||
#include "BlobParent.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsContentAreaDragDrop.h"
|
||||
#include "nsContentPermissionHelper.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsFocusManager.h"
|
||||
@@ -273,7 +271,6 @@ TabParent::TabParent(nsIContentParent* aManager,
|
||||
, mDefaultScale(0)
|
||||
, mShown(false)
|
||||
, mUpdatedDimensions(false)
|
||||
, mChromeOffset(0, 0)
|
||||
, mManager(aManager)
|
||||
, mMarkedDestroying(false)
|
||||
, mIsDestroyed(false)
|
||||
@@ -922,7 +919,7 @@ TabParent::UpdateDimensions(const nsIntRect& rect, const ScreenIntSize& size)
|
||||
hal::ScreenConfiguration config;
|
||||
hal::GetCurrentScreenConfiguration(&config);
|
||||
ScreenOrientation orientation = config.orientation();
|
||||
nsIntPoint chromeOffset = -LayoutDevicePixel::ToUntyped(GetChildProcessOffset());
|
||||
LayoutDeviceIntPoint chromeOffset = -GetChildProcessOffset();
|
||||
|
||||
if (!mUpdatedDimensions || mOrientation != orientation ||
|
||||
mDimensions != size || !mRect.IsEqualEdges(rect) ||
|
||||
@@ -1091,20 +1088,6 @@ TabParent::DeallocPDocumentRendererParent(PDocumentRendererParent* actor)
|
||||
return true;
|
||||
}
|
||||
|
||||
PContentPermissionRequestParent*
|
||||
TabParent::AllocPContentPermissionRequestParent(const InfallibleTArray<PermissionRequest>& aRequests,
|
||||
const IPC::Principal& aPrincipal)
|
||||
{
|
||||
return nsContentPermissionUtils::CreateContentPermissionRequestParent(aRequests, mFrameElement, aPrincipal);
|
||||
}
|
||||
|
||||
bool
|
||||
TabParent::DeallocPContentPermissionRequestParent(PContentPermissionRequestParent* actor)
|
||||
{
|
||||
delete actor;
|
||||
return true;
|
||||
}
|
||||
|
||||
PFilePickerParent*
|
||||
TabParent::AllocPFilePickerParent(const nsString& aTitle, const int16_t& aMode)
|
||||
{
|
||||
|
||||
+1
-7
@@ -330,12 +330,6 @@ public:
|
||||
const nsIntSize& renderSize) override;
|
||||
virtual bool DeallocPDocumentRendererParent(PDocumentRendererParent* actor) override;
|
||||
|
||||
virtual PContentPermissionRequestParent*
|
||||
AllocPContentPermissionRequestParent(const InfallibleTArray<PermissionRequest>& aRequests,
|
||||
const IPC::Principal& aPrincipal) override;
|
||||
virtual bool
|
||||
DeallocPContentPermissionRequestParent(PContentPermissionRequestParent* actor) override;
|
||||
|
||||
virtual PFilePickerParent*
|
||||
AllocPFilePickerParent(const nsString& aTitle,
|
||||
const int16_t& aMode) override;
|
||||
@@ -489,7 +483,7 @@ protected:
|
||||
CSSToLayoutDeviceScale mDefaultScale;
|
||||
bool mShown;
|
||||
bool mUpdatedDimensions;
|
||||
nsIntPoint mChromeOffset;
|
||||
LayoutDeviceIntPoint mChromeOffset;
|
||||
|
||||
private:
|
||||
already_AddRefed<nsFrameLoader> GetFrameLoader(bool aUseCachedFrameLoaderAfterDestroy = false) const;
|
||||
|
||||
@@ -130,6 +130,7 @@ private:
|
||||
nsRefPtr<dom::GetUserMediaRequest> mRequest;
|
||||
nsTArray<nsCOMPtr<nsIMediaDevice> > mAudioDevices; // candidate audio devices
|
||||
nsTArray<nsCOMPtr<nsIMediaDevice> > mVideoDevices; // candidate video devices
|
||||
nsCOMPtr<nsIContentPermissionRequester> mRequester;
|
||||
};
|
||||
|
||||
// MediaPermissionRequest
|
||||
@@ -156,6 +157,9 @@ MediaPermissionRequest::MediaPermissionRequest(nsRefPtr<dom::GetUserMediaRequest
|
||||
mVideoDevices.AppendElement(device);
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> window = GetOwner();
|
||||
mRequester = new nsContentPermissionRequester(window.get());
|
||||
}
|
||||
|
||||
// nsIContentPermissionRequest methods
|
||||
@@ -275,6 +279,16 @@ MediaPermissionRequest::Allow(JS::HandleValue aChoices)
|
||||
return DoAllow(audioDevice, videoDevice);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
MediaPermissionRequest::GetRequester(nsIContentPermissionRequester** aRequester)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRequester);
|
||||
|
||||
nsCOMPtr<nsIContentPermissionRequester> requester = mRequester;
|
||||
requester.forget(aRequester);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
MediaPermissionRequest::DoAllow(const nsString &audioDevice,
|
||||
const nsString &videoDevice)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "mozilla/CheckedInt.h"
|
||||
#include "nsIThread.h"
|
||||
#include "nsSize.h"
|
||||
#include "nsRect.h"
|
||||
|
||||
#if !(defined(XP_WIN) || defined(XP_MACOSX) || defined(LINUX)) || \
|
||||
defined(MOZ_ASAN)
|
||||
@@ -29,8 +30,6 @@ using mozilla::CheckedUint64;
|
||||
using mozilla::CheckedInt32;
|
||||
using mozilla::CheckedUint32;
|
||||
|
||||
struct nsIntRect;
|
||||
|
||||
// This file contains stuff we'd rather put elsewhere, but which is
|
||||
// dependent on other changes which we don't want to wait for. We plan to
|
||||
// remove this file in the near future.
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
#include "WMF.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
|
||||
struct nsIntRect;
|
||||
#include "nsRect.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
||||
@@ -30,12 +30,16 @@ class DesktopNotificationRequest : public nsIContentPermissionRequest
|
||||
{
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContentPermissionRequester> mRequester;
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSICONTENTPERMISSIONREQUEST
|
||||
|
||||
explicit DesktopNotificationRequest(DesktopNotification* aNotification)
|
||||
: mDesktopNotification(aNotification) {}
|
||||
: mDesktopNotification(aNotification)
|
||||
{
|
||||
mRequester = new nsContentPermissionRequester(mDesktopNotification->GetOwner());
|
||||
}
|
||||
|
||||
NS_IMETHOD Run() override
|
||||
{
|
||||
@@ -313,6 +317,16 @@ DesktopNotificationRequest::Allow(JS::HandleValue aChoices)
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DesktopNotificationRequest::GetRequester(nsIContentPermissionRequester** aRequester)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRequester);
|
||||
|
||||
nsCOMPtr<nsIContentPermissionRequester> requester = mRequester;
|
||||
requester.forget(aRequester);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DesktopNotificationRequest::GetTypes(nsIArray** aTypes)
|
||||
{
|
||||
|
||||
@@ -172,7 +172,10 @@ public:
|
||||
NotificationPermissionCallback* aCallback)
|
||||
: mPrincipal(aPrincipal), mWindow(aWindow),
|
||||
mPermission(NotificationPermission::Default),
|
||||
mCallback(aCallback) {}
|
||||
mCallback(aCallback)
|
||||
{
|
||||
mRequester = new nsContentPermissionRequester(mWindow);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~NotificationPermissionRequest() {}
|
||||
@@ -183,6 +186,7 @@ protected:
|
||||
nsCOMPtr<nsPIDOMWindow> mWindow;
|
||||
NotificationPermission mPermission;
|
||||
nsRefPtr<NotificationPermissionCallback> mCallback;
|
||||
nsCOMPtr<nsIContentPermissionRequester> mRequester;
|
||||
};
|
||||
|
||||
class NotificationObserver : public nsIObserver
|
||||
@@ -307,6 +311,16 @@ NotificationPermissionRequest::Allow(JS::HandleValue aChoices)
|
||||
return DispatchCallback();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
NotificationPermissionRequest::GetRequester(nsIContentPermissionRequester** aRequester)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRequester);
|
||||
|
||||
nsCOMPtr<nsIContentPermissionRequester> requester = mRequester;
|
||||
requester.forget(aRequester);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
inline nsresult
|
||||
NotificationPermissionRequest::DispatchCallback()
|
||||
{
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#endif
|
||||
|
||||
class nsIInputStream;
|
||||
struct nsIntRect;
|
||||
class nsPluginDOMContextMenuListener;
|
||||
class nsPluginFrame;
|
||||
class nsDisplayListBuilder;
|
||||
|
||||
@@ -26,7 +26,7 @@ using gfxIntSize from "nsSize.h";
|
||||
using struct mozilla::null_t from "ipc/IPCMessageUtils.h";
|
||||
using mozilla::plugins::WindowsSharedMemoryHandle from "mozilla/plugins/PluginMessageUtils.h";
|
||||
using mozilla::layers::SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h";
|
||||
using struct nsIntRect from "nsRect.h";
|
||||
using nsIntRect from "nsRect.h";
|
||||
|
||||
namespace mozilla {
|
||||
namespace plugins {
|
||||
|
||||
@@ -114,7 +114,7 @@ CreateDrawTargetForSurface(gfxASurface *aSurface)
|
||||
}
|
||||
RefPtr<DrawTarget> drawTarget =
|
||||
Factory::CreateDrawTargetForCairoSurface(aSurface->CairoSurface(),
|
||||
ToIntSize(gfxIntSize(aSurface->GetSize())),
|
||||
aSurface->GetSize(),
|
||||
&format);
|
||||
aSurface->SetData(&kDrawTarget, drawTarget, nullptr);
|
||||
return drawTarget;
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
#include "nsError.h"
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "nsSize.h"
|
||||
#include "nsRect.h"
|
||||
|
||||
class gfxContext;
|
||||
class nsCString;
|
||||
struct nsIntRect;
|
||||
class nsNPAPIPlugin;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
|
||||
#include "npapi.h"
|
||||
#include "mozilla/gfx/QuartzSupport.h"
|
||||
|
||||
struct nsIntRect;
|
||||
#include "nsRect.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace plugins {
|
||||
|
||||
@@ -284,7 +284,7 @@ txExprLexer::parse(const nsASingleFragmentString& aPattern)
|
||||
newToken = new Token(mPosition, Token::SUBTRACTION_OP);
|
||||
++mPosition;
|
||||
break;
|
||||
case ASTERIX:
|
||||
case ASTERISK:
|
||||
if (nextIsOperatorToken(prevToken)) {
|
||||
newToken = new Token(mPosition, Token::MULTIPLY_OP);
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
R_ANGLE = '>',
|
||||
COMMA = ',',
|
||||
PERIOD = '.',
|
||||
ASTERIX = '*',
|
||||
ASTERISK = '*',
|
||||
FORWARD_SLASH = '/',
|
||||
EQUAL = '=',
|
||||
BANG = '!',
|
||||
|
||||
@@ -35,7 +35,7 @@ bool txNameTest::matches(const txXPathNode& aNode, txIMatchContext* aContext)
|
||||
}
|
||||
|
||||
// Totally wild?
|
||||
if (mLocalName == nsGkAtoms::_asterix && !mPrefix)
|
||||
if (mLocalName == nsGkAtoms::_asterisk && !mPrefix)
|
||||
return true;
|
||||
|
||||
// Compare namespaces
|
||||
@@ -46,7 +46,7 @@ bool txNameTest::matches(const txXPathNode& aNode, txIMatchContext* aContext)
|
||||
return false;
|
||||
|
||||
// Name wild?
|
||||
if (mLocalName == nsGkAtoms::_asterix)
|
||||
if (mLocalName == nsGkAtoms::_asterisk)
|
||||
return true;
|
||||
|
||||
// Compare local-names
|
||||
@@ -58,7 +58,7 @@ bool txNameTest::matches(const txXPathNode& aNode, txIMatchContext* aContext)
|
||||
*/
|
||||
double txNameTest::getDefaultPriority()
|
||||
{
|
||||
if (mLocalName == nsGkAtoms::_asterix) {
|
||||
if (mLocalName == nsGkAtoms::_asterisk) {
|
||||
if (!mPrefix)
|
||||
return -0.5;
|
||||
return -0.25;
|
||||
|
||||
@@ -128,7 +128,7 @@ txXPathOptimizer::optimizeStep(Expr* aInExpr, Expr** aOutExpr)
|
||||
if (!step->getSubExprAt(0) &&
|
||||
step->getNodeTest()->getType() == txNameTest::NAME_TEST &&
|
||||
(nameTest = static_cast<txNameTest*>(step->getNodeTest()))->
|
||||
mLocalName != nsGkAtoms::_asterix) {
|
||||
mLocalName != nsGkAtoms::_asterisk) {
|
||||
|
||||
*aOutExpr = new txNamedAttributeStep(nameTest->mNamespace,
|
||||
nameTest->mPrefix,
|
||||
|
||||
@@ -1062,7 +1062,7 @@ txFnStartStripSpace(int32_t aNamespaceID,
|
||||
}
|
||||
prefix = localName;
|
||||
}
|
||||
localName = nsGkAtoms::_asterix;
|
||||
localName = nsGkAtoms::_asterisk;
|
||||
}
|
||||
if (prefix) {
|
||||
ns = aState.mElementContext->mMappings->lookupNamespace(prefix);
|
||||
|
||||
@@ -156,7 +156,7 @@ txXSLTNumber::getValueList(Expr* aValueExpr, txPattern* aCountPattern,
|
||||
{
|
||||
// this won't match anything as we walk up the tree
|
||||
// but it's what the spec says to do
|
||||
nodeTest = new txNameTest(0, nsGkAtoms::_asterix, 0,
|
||||
nodeTest = new txNameTest(0, nsGkAtoms::_asterisk, 0,
|
||||
nodeType);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -969,7 +969,7 @@ XULDocument::AttributeChanged(nsIDocument* aDocument,
|
||||
static_cast<BroadcastListener*>(entry->mListeners[i]);
|
||||
|
||||
if ((bl->mAttribute == aAttribute) ||
|
||||
(bl->mAttribute == nsGkAtoms::_asterix)) {
|
||||
(bl->mAttribute == nsGkAtoms::_asterisk)) {
|
||||
nsCOMPtr<Element> listenerEl
|
||||
= do_QueryReferent(bl->mListener);
|
||||
if (listenerEl) {
|
||||
@@ -4148,7 +4148,7 @@ XULDocument::BroadcastAttributeChangeFromOverlay(nsIContent* aNode,
|
||||
(entry->mListeners[i]);
|
||||
|
||||
if ((bl->mAttribute != aAttribute) &&
|
||||
(bl->mAttribute != nsGkAtoms::_asterix))
|
||||
(bl->mAttribute != nsGkAtoms::_asterisk))
|
||||
continue;
|
||||
|
||||
nsCOMPtr<nsIContent> l = do_QueryReferent(bl->mListener);
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "nsIAtom.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
|
||||
class nsXULTemplateQueryProcessorRDF;
|
||||
|
||||
/**
|
||||
* The nsContentTestNode is always the top node in a query's rule network. It
|
||||
* exists so that Constrain can filter out resources that aren't part of a
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
{0x8929ff60, 0x1c9c, 0x4d87, \
|
||||
{ 0xac, 0x02, 0x09, 0x14, 0x15, 0x3b, 0x48, 0xc4 }}
|
||||
|
||||
class nsXULTemplateQueryProcessorRDF;
|
||||
|
||||
/**
|
||||
* A compiled query in the RDF query processor. This interface should not be
|
||||
* used directly outside of the RDF query processor.
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include "nsIRDFNode.h"
|
||||
|
||||
class nsXULTemplateResultSetRDF;
|
||||
class nsXULTemplateQueryProcessorRDF;
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
class nsHTMLEditor;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class IMETextTxn;
|
||||
|
||||
@@ -33,10 +33,7 @@ class EditAggregateTxn;
|
||||
class RemoveStyleSheetTxn;
|
||||
class nsIAtom;
|
||||
class nsIContent;
|
||||
class nsIDOMCharacterData;
|
||||
class nsIDOMDataTransfer;
|
||||
class nsIDOMDocument;
|
||||
class nsIDOMElement;
|
||||
class nsIDOMEvent;
|
||||
class nsIDOMEventListener;
|
||||
class nsIDOMEventTarget;
|
||||
|
||||
@@ -26,7 +26,6 @@ class Element;
|
||||
} // namespace mozilla
|
||||
|
||||
class nsHTMLEditor;
|
||||
class nsIDOMWindow;
|
||||
|
||||
typedef void (*nsProcessValueFunc)(const nsAString * aInputString, nsAString & aOutputString,
|
||||
const char * aDefaultValueString,
|
||||
|
||||
@@ -43,11 +43,9 @@
|
||||
|
||||
class nsIDOMKeyEvent;
|
||||
class nsITransferable;
|
||||
class nsIDocumentEncoder;
|
||||
class nsIClipboard;
|
||||
class TypeInState;
|
||||
class nsIContentFilter;
|
||||
class nsIURL;
|
||||
class nsILinkHandler;
|
||||
class nsTableOuterFrame;
|
||||
class nsIDOMRange;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
class nsEditor;
|
||||
class nsHTMLEditor;
|
||||
class nsIDOMEvent;
|
||||
|
||||
class nsHTMLEditorEventListener : public nsEditorEventListener
|
||||
{
|
||||
|
||||
@@ -20,7 +20,6 @@ Transaction interface to outside world
|
||||
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }
|
||||
|
||||
class nsSelectionState;
|
||||
class nsIEditor;
|
||||
class nsIAtom;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,11 +16,9 @@
|
||||
#include "nscore.h"
|
||||
|
||||
class nsIContent;
|
||||
class nsIDOMDataTransfer;
|
||||
class nsIDOMDocument;
|
||||
class nsIDOMElement;
|
||||
class nsIDOMEvent;
|
||||
class nsIDOMEventTarget;
|
||||
class nsIDOMKeyEvent;
|
||||
class nsIDOMNode;
|
||||
class nsIDocumentEncoder;
|
||||
|
||||
@@ -8,12 +8,6 @@
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class Element;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
class nsIDOMNode;
|
||||
class nsINode;
|
||||
class nsPlaintextEditor;
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "mozilla/dom/Text.h"
|
||||
|
||||
class nsHTMLEditor;
|
||||
class nsIDOMDocument;
|
||||
class nsIDOMNode;
|
||||
struct DOMPoint;
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
class nsITransaction;
|
||||
class nsITransactionListener;
|
||||
class nsTransactionItem;
|
||||
|
||||
/** implementation of a transaction manager object.
|
||||
*
|
||||
|
||||
@@ -41,8 +41,6 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsWeakPtr.h"
|
||||
|
||||
class nsIContentViewerFile;
|
||||
|
||||
class nsWebBrowserInitInfo
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "nsIContentIterator.h"
|
||||
#include "nsIWordBreaker.h"
|
||||
|
||||
class nsIAtom;
|
||||
class nsIContent;
|
||||
|
||||
#define NS_FIND_CONTRACTID "@mozilla.org/embedcomp/rangefind;1"
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
#include "nsPrintProgress.h"
|
||||
#include "nsIWebProgressListener.h"
|
||||
|
||||
|
||||
class nsIDOMWindow;
|
||||
class nsIDialogParamBlock;
|
||||
|
||||
class nsPrintingPromptService: public nsIPrintingPromptService,
|
||||
public nsIWebProgressListener
|
||||
{
|
||||
|
||||
@@ -23,10 +23,7 @@ class nsIURI;
|
||||
class nsIDocShellTreeItem;
|
||||
class nsIDocShellTreeOwner;
|
||||
class nsPIDOMWindow;
|
||||
class nsIWebBrowserChrome;
|
||||
class nsString;
|
||||
class nsWatcherWindowEnumerator;
|
||||
class nsIScriptContext;
|
||||
class nsPromptService;
|
||||
struct nsWatcherWindowEntry;
|
||||
struct SizeSpec;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#undef KeyPress
|
||||
#endif
|
||||
|
||||
class nsIDOMMouseEventListener;
|
||||
class mozInlineSpellWordUtil;
|
||||
class mozInlineSpellChecker;
|
||||
class mozInlineSpellResume;
|
||||
|
||||
@@ -43,7 +43,6 @@ struct ID2D1Device;
|
||||
struct IDWriteRenderingParams;
|
||||
|
||||
class GrContext;
|
||||
struct GrGLInterface;
|
||||
|
||||
struct CGContext;
|
||||
typedef struct CGContext *CGContextRef;
|
||||
|
||||
@@ -23,8 +23,6 @@ namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
class SourceSurfaceD2D1;
|
||||
class GradientStopsD2D;
|
||||
class ScaledFontDWrite;
|
||||
|
||||
const int32_t kLayerCacheSize1 = 5;
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
class DrawTargetCairo;
|
||||
class PathCairo;
|
||||
|
||||
class PathBuilderCairo : public PathBuilder
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
CGColorSpaceRef CreateSystemColorSpace();
|
||||
|
||||
// Manages a CARenderer
|
||||
struct _CGLPBufferObject;
|
||||
struct _CGLContextObject;
|
||||
|
||||
enum AllowOfflineRendererEnum { ALLOW_OFFLINE_RENDERER, DISALLOW_OFFLINE_RENDERER };
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "BaseRect.h"
|
||||
#include "BaseMargin.h"
|
||||
#include "NumericTools.h"
|
||||
#include "Point.h"
|
||||
#include "Tools.h"
|
||||
|
||||
@@ -105,6 +106,21 @@ struct IntRectTyped :
|
||||
{
|
||||
return IntRectTyped<units>::IsEqualEdges(aRect);
|
||||
}
|
||||
|
||||
void InflateToMultiple(const IntSizeTyped<units>& aTileSize)
|
||||
{
|
||||
int32_t yMost = this->YMost();
|
||||
int32_t xMost = this->XMost();
|
||||
|
||||
this->x = RoundDownToMultiple(this->x, aTileSize.width);
|
||||
this->y = RoundDownToMultiple(this->y, aTileSize.height);
|
||||
xMost = RoundUpToMultiple(xMost, aTileSize.width);
|
||||
yMost = RoundUpToMultiple(yMost, aTileSize.height);
|
||||
|
||||
this->width = xMost - this->x;
|
||||
this->height = yMost - this->y;
|
||||
}
|
||||
|
||||
};
|
||||
typedef IntRectTyped<UnknownUnits> IntRect;
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#include "cairo.h"
|
||||
#endif
|
||||
|
||||
class gfxFont;
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
#include "skia/include/core/SkCanvas.h"
|
||||
#include "skia/include/core/SkBitmap.h"
|
||||
|
||||
class GrContext;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
namespace gfx {
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
#include "SurfaceTexture.h"
|
||||
#include "AndroidNativeWindow.h"
|
||||
|
||||
class gfxASurface;
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
class Matrix4x4;
|
||||
|
||||
@@ -51,10 +51,6 @@
|
||||
#include "gfx2DGlue.h"
|
||||
#include "GeckoProfiler.h"
|
||||
|
||||
class nsIntRegion;
|
||||
class nsIRunnable;
|
||||
class nsIThread;
|
||||
|
||||
namespace android {
|
||||
class GraphicBuffer;
|
||||
} // namespace android
|
||||
|
||||
@@ -310,10 +310,8 @@ GLContextProviderCGL::CreateOffscreen(const gfxIntSize& size,
|
||||
bool requireCompatProfile)
|
||||
{
|
||||
nsRefPtr<GLContext> glContext = CreateHeadless(requireCompatProfile);
|
||||
if (!glContext->InitOffscreen(ToIntSize(size), caps)) {
|
||||
NS_WARNING("Failed during InitOffscreen.");
|
||||
if (!glContext->InitOffscreen(size, caps))
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return glContext.forget();
|
||||
}
|
||||
|
||||
@@ -902,7 +902,7 @@ GLContextProviderEGL::CreateOffscreen(const gfxIntSize& size,
|
||||
if (!glContext)
|
||||
return nullptr;
|
||||
|
||||
if (!glContext->InitOffscreen(ToIntSize(size), caps))
|
||||
if (!glContext->InitOffscreen(size, caps))
|
||||
return nullptr;
|
||||
|
||||
return glContext.forget();
|
||||
|
||||
@@ -1229,7 +1229,7 @@ GLContextProviderGLX::CreateOffscreen(const gfxIntSize& size,
|
||||
if (!glContext)
|
||||
return nullptr;
|
||||
|
||||
if (!glContext->InitOffscreen(ToIntSize(size), caps))
|
||||
if (!glContext->InitOffscreen(size, caps))
|
||||
return nullptr;
|
||||
|
||||
return glContext.forget();
|
||||
|
||||
@@ -635,7 +635,7 @@ GLContextProviderWGL::CreateHeadless(bool)
|
||||
}
|
||||
|
||||
already_AddRefed<GLContext>
|
||||
GLContextProviderWGL::CreateOffscreen(const gfxIntSize& size,
|
||||
GLContextProviderWGL::CreateOffscreen(const IntSize& size,
|
||||
const SurfaceCaps& caps,
|
||||
bool requireCompatProfile)
|
||||
{
|
||||
@@ -643,7 +643,7 @@ GLContextProviderWGL::CreateOffscreen(const gfxIntSize& size,
|
||||
if (!glContext)
|
||||
return nullptr;
|
||||
|
||||
if (!glContext->InitOffscreen(ToIntSize(size), caps))
|
||||
if (!glContext->InitOffscreen(size, caps))
|
||||
return nullptr;
|
||||
|
||||
return glContext.forget();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user