mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge m-i to m-c, a=merge
This commit is contained in:
commit
fa7e5419f9
@ -9,8 +9,8 @@ include protocol PContent;
|
||||
include "mozilla/GfxMessageUtils.h";
|
||||
|
||||
using struct nsIntPoint from "nsRect.h";
|
||||
using struct nsIntSize from "nsRect.h";
|
||||
using struct nsIntRect from "nsRect.h";
|
||||
using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
@ -131,7 +131,7 @@ child:
|
||||
prio(high) sync PasteText(uint64_t aID, int32_t aPosition);
|
||||
|
||||
prio(high) sync ImagePosition(uint64_t aID, uint32_t aCoordType) returns(nsIntPoint aRetVal);
|
||||
prio(high) sync ImageSize(uint64_t aID) returns(nsIntSize aRetVal);
|
||||
prio(high) sync ImageSize(uint64_t aID) returns(IntSize aRetVal);
|
||||
|
||||
prio(high) sync StartOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk);
|
||||
prio(high) sync EndOffset(uint64_t aID) returns(uint32_t aRetVal, bool aOk);
|
||||
|
@ -29,7 +29,7 @@ const Subject = Class({
|
||||
object: object
|
||||
};
|
||||
},
|
||||
getHelperForLanguage: function() {},
|
||||
getScriptableHelper: function() {},
|
||||
getInterfaces: function() {}
|
||||
});
|
||||
|
||||
|
@ -229,10 +229,24 @@ Animation::ActiveDuration(const AnimationTiming& aTiming)
|
||||
aTiming.mIterationDuration.MultDouble(aTiming.mIterationCount));
|
||||
}
|
||||
|
||||
// http://w3c.github.io/web-animations/#in-play
|
||||
bool
|
||||
Animation::IsCurrent() const
|
||||
Animation::IsInPlay(const AnimationPlayer& aPlayer) const
|
||||
{
|
||||
if (IsFinishedTransition()) {
|
||||
if (IsFinishedTransition() ||
|
||||
aPlayer.PlayState() == AnimationPlayState::Finished) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return GetComputedTiming().mPhase == ComputedTiming::AnimationPhase_Active;
|
||||
}
|
||||
|
||||
// http://w3c.github.io/web-animations/#current
|
||||
bool
|
||||
Animation::IsCurrent(const AnimationPlayer& aPlayer) const
|
||||
{
|
||||
if (IsFinishedTransition() ||
|
||||
aPlayer.PlayState() == AnimationPlayState::Finished) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,8 @@ public:
|
||||
mIsFinishedTransition = true;
|
||||
}
|
||||
|
||||
bool IsCurrent() const;
|
||||
bool IsInPlay(const AnimationPlayer& aPlayer) const;
|
||||
bool IsCurrent(const AnimationPlayer& aPlayer) const;
|
||||
bool IsInEffect() const;
|
||||
|
||||
const AnimationProperty*
|
||||
|
@ -351,19 +351,6 @@ AnimationPlayer::Cancel()
|
||||
UpdateSourceContent();
|
||||
}
|
||||
|
||||
bool
|
||||
AnimationPlayer::IsRunning() const
|
||||
{
|
||||
if (IsPausedOrPausing() ||
|
||||
!GetSource() ||
|
||||
GetSource()->IsFinishedTransition()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ComputedTiming computedTiming = GetSource()->GetComputedTiming();
|
||||
return computedTiming.mPhase == ComputedTiming::AnimationPhase_Active;
|
||||
}
|
||||
|
||||
void
|
||||
AnimationPlayer::UpdateRelevance()
|
||||
{
|
||||
|
@ -201,17 +201,34 @@ public:
|
||||
return PlayState() == AnimationPlayState::Paused ||
|
||||
mPendingState == PendingState::PausePending;
|
||||
}
|
||||
bool IsRunning() const;
|
||||
|
||||
bool HasInPlaySource() const
|
||||
{
|
||||
return GetSource() && GetSource()->IsInPlay(*this);
|
||||
}
|
||||
bool HasCurrentSource() const
|
||||
{
|
||||
return GetSource() && GetSource()->IsCurrent();
|
||||
return GetSource() && GetSource()->IsCurrent(*this);
|
||||
}
|
||||
bool HasInEffectSource() const
|
||||
{
|
||||
return GetSource() && GetSource()->IsInEffect();
|
||||
}
|
||||
|
||||
/**
|
||||
* "Playing" is different to "running". An animation in its delay phase is
|
||||
* still running but we only consider it playing when it is in its active
|
||||
* interval. This definition is used for fetching the animations that are
|
||||
* are candidates for running on the compositor (since we don't ship
|
||||
* animations to the compositor when they are in their delay phase or
|
||||
* paused).
|
||||
*/
|
||||
bool IsPlaying() const
|
||||
{
|
||||
return HasInPlaySource() && // Check we are in the active interval
|
||||
PlayState() == AnimationPlayState::Running; // And not paused
|
||||
}
|
||||
|
||||
bool IsRelevant() const { return mIsRelevant; }
|
||||
void UpdateRelevance();
|
||||
|
||||
|
@ -829,16 +829,10 @@ nsDOMClassInfo::GetInterfaces(uint32_t *aCount, nsIID ***aArray)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMClassInfo::GetHelperForLanguage(uint32_t language, nsISupports **_retval)
|
||||
nsDOMClassInfo::GetScriptableHelper(nsIXPCScriptable **_retval)
|
||||
{
|
||||
if (language == nsIProgrammingLanguage::JAVASCRIPT) {
|
||||
*_retval = static_cast<nsIXPCScriptable *>(this);
|
||||
|
||||
NS_ADDREF(*_retval);
|
||||
} else {
|
||||
*_retval = nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIXPCScriptable> rval = this;
|
||||
rval.forget(_retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "mozilla/dom/WindowBinding.h"
|
||||
#include "Units.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsSize.h"
|
||||
|
||||
#define DEFAULT_HOME_PAGE "www.mozilla.org"
|
||||
#define PREF_BROWSER_STARTUP_HOMEPAGE "browser.startup.homepage"
|
||||
@ -90,7 +91,6 @@ class nsGlobalWindowObserver;
|
||||
class nsGlobalWindow;
|
||||
class nsDOMWindowUtils;
|
||||
class nsIIdleService;
|
||||
struct nsIntSize;
|
||||
struct nsRect;
|
||||
|
||||
class nsWindowSizes;
|
||||
|
@ -202,7 +202,7 @@ nsHostObjectURI::GetInterfaces(uint32_t *count, nsIID * **array)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHostObjectURI::GetHelperForLanguage(uint32_t language, nsISupports **_retval)
|
||||
nsHostObjectURI::GetScriptableHelper(nsIXPCScriptable **_retval)
|
||||
{
|
||||
*_retval = nullptr;
|
||||
return NS_OK;
|
||||
|
@ -216,12 +216,6 @@ public:
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS(StackFrame)
|
||||
NS_DECL_NSISTACKFRAME
|
||||
|
||||
StackFrame(uint32_t aLanguage,
|
||||
const char* aFilename,
|
||||
const char* aFunctionName,
|
||||
int32_t aLineNumber,
|
||||
nsIStackFrame* aCaller);
|
||||
|
||||
StackFrame()
|
||||
: mLineno(0)
|
||||
, mColNo(0)
|
||||
@ -229,12 +223,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
static already_AddRefed<nsIStackFrame>
|
||||
CreateStackFrameLocation(uint32_t aLanguage,
|
||||
const char* aFilename,
|
||||
const char* aFunctionName,
|
||||
int32_t aLineNumber,
|
||||
nsIStackFrame* aCaller);
|
||||
protected:
|
||||
virtual ~StackFrame();
|
||||
|
||||
@ -263,19 +251,6 @@ protected:
|
||||
uint32_t mLanguage;
|
||||
};
|
||||
|
||||
StackFrame::StackFrame(uint32_t aLanguage,
|
||||
const char* aFilename,
|
||||
const char* aFunctionName,
|
||||
int32_t aLineNumber,
|
||||
nsIStackFrame* aCaller)
|
||||
: mCaller(aCaller)
|
||||
, mLineno(aLineNumber)
|
||||
, mLanguage(aLanguage)
|
||||
{
|
||||
CopyUTF8toUTF16(aFilename, mFilename);
|
||||
CopyUTF8toUTF16(aFunctionName, mFunname);
|
||||
}
|
||||
|
||||
StackFrame::~StackFrame()
|
||||
{
|
||||
}
|
||||
@ -855,36 +830,12 @@ JSStackFrame::CreateStack(JSContext* aCx, int32_t aMaxDepth)
|
||||
return first.forget();
|
||||
}
|
||||
|
||||
/* static */ already_AddRefed<nsIStackFrame>
|
||||
StackFrame::CreateStackFrameLocation(uint32_t aLanguage,
|
||||
const char* aFilename,
|
||||
const char* aFunctionName,
|
||||
int32_t aLineNumber,
|
||||
nsIStackFrame* aCaller)
|
||||
{
|
||||
nsRefPtr<StackFrame> self =
|
||||
new StackFrame(aLanguage, aFilename, aFunctionName, aLineNumber, aCaller);
|
||||
return self.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIStackFrame>
|
||||
CreateStack(JSContext* aCx, int32_t aMaxDepth)
|
||||
{
|
||||
return JSStackFrame::CreateStack(aCx, aMaxDepth);
|
||||
}
|
||||
|
||||
already_AddRefed<nsIStackFrame>
|
||||
CreateStackFrameLocation(uint32_t aLanguage,
|
||||
const char* aFilename,
|
||||
const char* aFunctionName,
|
||||
int32_t aLineNumber,
|
||||
nsIStackFrame* aCaller)
|
||||
{
|
||||
return StackFrame::CreateStackFrameLocation(aLanguage, aFilename,
|
||||
aFunctionName, aLineNumber,
|
||||
aCaller);
|
||||
}
|
||||
|
||||
} // namespace exceptions
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -65,13 +65,6 @@ namespace exceptions {
|
||||
already_AddRefed<nsIStackFrame>
|
||||
CreateStack(JSContext* aCx, int32_t aMaxDepth = -1);
|
||||
|
||||
already_AddRefed<nsIStackFrame>
|
||||
CreateStackFrameLocation(uint32_t aLanguage,
|
||||
const char* aFilename,
|
||||
const char* aFunctionName,
|
||||
int32_t aLineNumber,
|
||||
nsIStackFrame* aCaller);
|
||||
|
||||
} // namespace exceptions
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -2056,19 +2056,13 @@ CreateStyleRule(nsINode* aNode,
|
||||
}
|
||||
|
||||
if (aProp1 != eCSSProperty_UNKNOWN) {
|
||||
error = parser.ParseProperty(aProp1, aValue1, docURL, baseURL, principal,
|
||||
rule->GetDeclaration(), aChanged1, false);
|
||||
if (error.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
parser.ParseProperty(aProp1, aValue1, docURL, baseURL, principal,
|
||||
rule->GetDeclaration(), aChanged1, false);
|
||||
}
|
||||
|
||||
if (aProp2 != eCSSProperty_UNKNOWN) {
|
||||
error = parser.ParseProperty(aProp2, aValue2, docURL, baseURL, principal,
|
||||
rule->GetDeclaration(), aChanged2, false);
|
||||
if (error.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
parser.ParseProperty(aProp2, aValue2, docURL, baseURL, principal,
|
||||
rule->GetDeclaration(), aChanged2, false);
|
||||
}
|
||||
|
||||
rule->RuleMatched();
|
||||
@ -4139,7 +4133,7 @@ CanvasRenderingContext2D::CachedSurfaceFromElement(Element* aElement)
|
||||
res.mCORSUsed = corsmode != imgIRequest::CORS_NONE;
|
||||
}
|
||||
|
||||
res.mSize = ThebesIntSize(res.mSourceSurface->GetSize());
|
||||
res.mSize = res.mSourceSurface->GetSize();
|
||||
res.mPrincipal = principal.forget();
|
||||
res.mIsWriteOnly = false;
|
||||
res.mImageRequest = imgRequest.forget();
|
||||
@ -4343,7 +4337,7 @@ CanvasRenderingContext2D::DrawImage(const HTMLImageOrCanvasOrVideoElement& image
|
||||
if (res.mSourceSurface) {
|
||||
if (res.mImageRequest) {
|
||||
CanvasImageCache::NotifyDrawImage(element, mCanvasElement, res.mImageRequest,
|
||||
res.mSourceSurface, ThebesIntSize(imgSize));
|
||||
res.mSourceSurface, imgSize);
|
||||
}
|
||||
|
||||
srcSurf = res.mSourceSurface;
|
||||
|
@ -40,7 +40,7 @@ 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 struct nsIntSize from "nsSize.h";
|
||||
using mozilla::gfx::IntSize from "mozilla/gfx/Point.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";
|
||||
@ -605,7 +605,7 @@ child:
|
||||
PDocumentRenderer(nsRect documentRect, Matrix transform,
|
||||
nsString bgcolor,
|
||||
uint32_t renderFlags, bool flushLayout,
|
||||
nsIntSize renderSize);
|
||||
IntSize renderSize);
|
||||
|
||||
/**
|
||||
* Sent by the chrome process when it no longer wants this remote
|
||||
|
@ -7,7 +7,7 @@ include protocol PBrowser;
|
||||
|
||||
include "mozilla/GfxMessageUtils.h";
|
||||
|
||||
using struct nsIntSize from "nsSize.h";
|
||||
using nsIntSize from "nsSize.h";
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
@ -257,7 +257,7 @@ VideoData::Create(VideoInfo& aInfo,
|
||||
aDuration,
|
||||
aKeyframe,
|
||||
aTimecode,
|
||||
aInfo.mDisplay.ToIntSize()));
|
||||
aInfo.mDisplay));
|
||||
return v.forget();
|
||||
}
|
||||
|
||||
@ -299,7 +299,7 @@ VideoData::Create(VideoInfo& aInfo,
|
||||
aDuration,
|
||||
aKeyframe,
|
||||
aTimecode,
|
||||
aInfo.mDisplay.ToIntSize()));
|
||||
aInfo.mDisplay));
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
const YCbCrBuffer::Plane &Y = aBuffer.mPlanes[0];
|
||||
const YCbCrBuffer::Plane &Cb = aBuffer.mPlanes[1];
|
||||
@ -401,7 +401,7 @@ VideoData::CreateFromImage(VideoInfo& aInfo,
|
||||
aDuration,
|
||||
aKeyframe,
|
||||
aTimecode,
|
||||
aInfo.mDisplay.ToIntSize()));
|
||||
aInfo.mDisplay));
|
||||
v->mImage = aImage;
|
||||
return v.forget();
|
||||
}
|
||||
@ -427,7 +427,7 @@ VideoData::Create(VideoInfo& aInfo,
|
||||
aDuration,
|
||||
aKeyframe,
|
||||
aTimecode,
|
||||
aInfo.mDisplay.ToIntSize()));
|
||||
aInfo.mDisplay));
|
||||
return v.forget();
|
||||
}
|
||||
|
||||
@ -454,7 +454,7 @@ VideoData::Create(VideoInfo& aInfo,
|
||||
aDuration,
|
||||
aKeyframe,
|
||||
aTimecode,
|
||||
aInfo.mDisplay.ToIntSize()));
|
||||
aInfo.mDisplay));
|
||||
|
||||
v->mImage = aContainer->CreateImage(ImageFormat::GRALLOC_PLANAR_YCBCR);
|
||||
if (!v->mImage) {
|
||||
|
@ -2797,8 +2797,7 @@ void MediaDecoderStateMachine::RenderVideoFrame(VideoData* aData,
|
||||
} else {
|
||||
mCorruptFrames.insert(0);
|
||||
}
|
||||
container->SetCurrentFrame(ThebesIntSize(aData->mDisplay), aData->mImage,
|
||||
aTarget);
|
||||
container->SetCurrentFrame(aData->mDisplay, aData->mImage, aTarget);
|
||||
MOZ_ASSERT(container->GetFrameDelay() >= 0 || IsRealTime());
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ VideoSegment::AppendFrame(already_AddRefed<Image>&& aImage,
|
||||
bool aForceBlack)
|
||||
{
|
||||
VideoChunk* chunk = AppendChunk(aDuration);
|
||||
VideoFrame frame(aImage, ThebesIntSize(aIntrinsicSize));
|
||||
VideoFrame frame(aImage, aIntrinsicSize);
|
||||
frame.SetForceBlack(aForceBlack);
|
||||
chunk->mFrame.TakeFrom(&frame);
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "mozilla/ReentrantMonitor.h"
|
||||
#include "mozilla/CheckedInt.h"
|
||||
#include "nsIThread.h"
|
||||
#include "nsSize.h"
|
||||
|
||||
#if !(defined(XP_WIN) || defined(XP_MACOSX) || defined(LINUX)) || \
|
||||
defined(MOZ_ASAN)
|
||||
@ -27,7 +28,6 @@ using mozilla::CheckedUint64;
|
||||
using mozilla::CheckedInt32;
|
||||
using mozilla::CheckedUint32;
|
||||
|
||||
struct nsIntSize;
|
||||
struct nsIntRect;
|
||||
|
||||
// This file contains stuff we'd rather put elsewhere, but which is
|
||||
|
@ -240,7 +240,7 @@ VideoTrackEncoder::AppendVideoSegment(const VideoSegment& aSegment)
|
||||
nsRefPtr<layers::Image> image = chunk.mFrame.GetImage();
|
||||
mRawSegment.AppendFrame(image.forget(),
|
||||
chunk.GetDuration(),
|
||||
chunk.mFrame.GetIntrinsicSize().ToIntSize(),
|
||||
chunk.mFrame.GetIntrinsicSize(),
|
||||
chunk.mFrame.GetForceBlack());
|
||||
iter.Next();
|
||||
}
|
||||
|
@ -1121,7 +1121,7 @@ void GStreamerReader::VideoPreroll()
|
||||
if (IsValidVideoRegion(frameSize, pictureRect, displaySize)) {
|
||||
GstStructure* structure = gst_caps_get_structure(caps, 0);
|
||||
gst_structure_get_fraction(structure, "framerate", &fpsNum, &fpsDen);
|
||||
mInfo.mVideo.mDisplay = ThebesIntSize(displaySize.ToIntSize());
|
||||
mInfo.mVideo.mDisplay = displaySize;
|
||||
mInfo.mVideo.mHasVideo = true;
|
||||
} else {
|
||||
LOG(PR_LOG_DEBUG, "invalid video region");
|
||||
|
@ -16,7 +16,7 @@ SpeechTaskCallback.prototype = {
|
||||
|
||||
getInterfaces: function(c) {},
|
||||
|
||||
getHelperForLanguage: function() {},
|
||||
getScriptableHelper: function() {},
|
||||
|
||||
onPause: function onPause() {
|
||||
if (this.onpause)
|
||||
@ -58,7 +58,7 @@ var TestSpeechServiceWithAudio = SpecialPowers.wrapCallbackObject({
|
||||
|
||||
getInterfaces: function(c) {},
|
||||
|
||||
getHelperForLanguage: function() {}
|
||||
getScriptableHelper: function() {}
|
||||
});
|
||||
|
||||
var TestSpeechServiceNoAudio = SpecialPowers.wrapCallbackObject({
|
||||
@ -98,7 +98,7 @@ var TestSpeechServiceNoAudio = SpecialPowers.wrapCallbackObject({
|
||||
|
||||
getInterfaces: function(c) {},
|
||||
|
||||
getHelperForLanguage: function() {},
|
||||
getScriptableHelper: function() {},
|
||||
|
||||
expectedSpeaks: []
|
||||
});
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
|
||||
struct nsIntSize;
|
||||
struct nsIntRect;
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -6,6 +6,7 @@
|
||||
#ifndef nsNPAPIPluginInstance_h_
|
||||
#define nsNPAPIPluginInstance_h_
|
||||
|
||||
#include "nsSize.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
|
@ -641,7 +641,7 @@ PluginInstanceParent::RecvShow(const NPRect& updatedRect,
|
||||
NS_ASSERTION(image->GetFormat() == ImageFormat::CAIRO_SURFACE, "Wrong format?");
|
||||
CairoImage* cairoImage = static_cast<CairoImage*>(image.get());
|
||||
CairoImage::Data cairoData;
|
||||
cairoData.mSize = surface->GetSize().ToIntSize();
|
||||
cairoData.mSize = surface->GetSize();
|
||||
cairoData.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface);
|
||||
cairoImage->SetData(cairoData);
|
||||
|
||||
|
@ -14,11 +14,11 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsError.h"
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "nsSize.h"
|
||||
|
||||
class gfxContext;
|
||||
class nsCString;
|
||||
struct nsIntRect;
|
||||
struct nsIntSize;
|
||||
class nsNPAPIPlugin;
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -120,13 +120,13 @@ BasicTextureImage::BeginUpdate(nsIntRegion& aRegion)
|
||||
if (CanUploadSubTextures(mGLContext)) {
|
||||
GetUpdateRegion(aRegion);
|
||||
} else {
|
||||
aRegion = nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize));
|
||||
aRegion = nsIntRect(nsIntPoint(0, 0), mSize);
|
||||
}
|
||||
|
||||
mUpdateRegion = aRegion;
|
||||
|
||||
nsIntRect rgnSize = mUpdateRegion.GetBounds();
|
||||
if (!nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize)).Contains(rgnSize)) {
|
||||
if (!nsIntRect(nsIntPoint(0, 0), mSize).Contains(rgnSize)) {
|
||||
NS_ERROR("update outside of image");
|
||||
return nullptr;
|
||||
}
|
||||
@ -146,8 +146,9 @@ BasicTextureImage::GetUpdateRegion(nsIntRegion& aForRegion)
|
||||
// if the texture hasn't been initialized yet, or something important
|
||||
// changed, we need to recreate our backing surface and force the
|
||||
// client to paint everything
|
||||
if (mTextureState != Valid)
|
||||
aForRegion = nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize));
|
||||
if (mTextureState != Valid) {
|
||||
aForRegion = nsIntRect(nsIntPoint(0, 0), mSize);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -265,7 +266,7 @@ gfx::IntSize TextureImage::GetSize() const {
|
||||
|
||||
TextureImage::TextureImage(const gfx::IntSize& aSize,
|
||||
GLenum aWrapMode, ContentType aContentType,
|
||||
Flags aFlags)
|
||||
Flags aFlags, ImageFormat aImageFormat)
|
||||
: mSize(aSize)
|
||||
, mWrapMode(aWrapMode)
|
||||
, mContentType(aContentType)
|
||||
@ -273,21 +274,6 @@ TextureImage::TextureImage(const gfx::IntSize& aSize,
|
||||
, mFlags(aFlags)
|
||||
{}
|
||||
|
||||
BasicTextureImage::BasicTextureImage(GLuint aTexture,
|
||||
const nsIntSize& aSize,
|
||||
GLenum aWrapMode,
|
||||
ContentType aContentType,
|
||||
GLContext* aContext,
|
||||
TextureImage::Flags aFlags /* = TextureImage::NoFlags */,
|
||||
TextureImage::ImageFormat aImageFormat /* = gfxImageFormat::Unknown */)
|
||||
: TextureImage(aSize, aWrapMode, aContentType, aFlags, aImageFormat)
|
||||
, mTexture(aTexture)
|
||||
, mTextureState(Created)
|
||||
, mGLContext(aContext)
|
||||
, mUpdateOffset(0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
BasicTextureImage::BasicTextureImage(GLuint aTexture,
|
||||
const gfx::IntSize& aSize,
|
||||
GLenum aWrapMode,
|
||||
@ -295,7 +281,7 @@ BasicTextureImage::BasicTextureImage(GLuint aTexture,
|
||||
GLContext* aContext,
|
||||
TextureImage::Flags aFlags,
|
||||
TextureImage::ImageFormat aImageFormat)
|
||||
: TextureImage(ThebesIntSize(aSize), aWrapMode, aContentType, aFlags, aImageFormat)
|
||||
: TextureImage(aSize, aWrapMode, aContentType, aFlags, aImageFormat)
|
||||
, mTexture(aTexture)
|
||||
, mTextureState(Created)
|
||||
, mGLContext(aContext)
|
||||
@ -414,7 +400,7 @@ TiledTextureImage::GetUpdateRegion(nsIntRegion& aForRegion)
|
||||
// if the texture hasn't been initialized yet, or something important
|
||||
// changed, we need to recreate our backing surface and force the
|
||||
// client to paint everything
|
||||
aForRegion = nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize));
|
||||
aForRegion = nsIntRect(nsIntPoint(0, 0), mSize);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -426,7 +412,7 @@ TiledTextureImage::GetUpdateRegion(nsIntRegion& aForRegion)
|
||||
int xPos = (i % mColumns) * mTileSize;
|
||||
int yPos = (i / mColumns) * mTileSize;
|
||||
nsIntRect imageRect = nsIntRect(nsIntPoint(xPos,yPos),
|
||||
ThebesIntSize(mImages[i]->GetSize()));
|
||||
mImages[i]->GetSize());
|
||||
|
||||
if (aForRegion.Intersects(imageRect)) {
|
||||
// Make a copy of the region
|
||||
@ -460,7 +446,7 @@ TiledTextureImage::BeginUpdate(nsIntRegion& aRegion)
|
||||
// if the texture hasn't been initialized yet, or something important
|
||||
// changed, we need to recreate our backing surface and force the
|
||||
// client to paint everything
|
||||
aRegion = nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize));
|
||||
aRegion = nsIntRect(nsIntPoint(0, 0), mSize);
|
||||
}
|
||||
|
||||
nsIntRect bounds = aRegion.GetBounds();
|
||||
@ -470,7 +456,7 @@ TiledTextureImage::BeginUpdate(nsIntRegion& aRegion)
|
||||
int yPos = (i / mColumns) * mTileSize;
|
||||
nsIntRegion imageRegion =
|
||||
nsIntRegion(nsIntRect(nsIntPoint(xPos,yPos),
|
||||
ThebesIntSize(mImages[i]->GetSize())));
|
||||
mImages[i]->GetSize()));
|
||||
|
||||
// a single Image can handle this update request
|
||||
if (imageRegion.Contains(aRegion)) {
|
||||
@ -499,7 +485,7 @@ TiledTextureImage::BeginUpdate(nsIntRegion& aRegion)
|
||||
(GetContentType() == gfxContentType::COLOR) ?
|
||||
gfx::SurfaceFormat::B8G8R8X8: gfx::SurfaceFormat::B8G8R8A8;
|
||||
mUpdateDrawTarget = gfx::Factory::CreateDrawTarget(gfx::BackendType::CAIRO,
|
||||
bounds.Size().ToIntSize(),
|
||||
bounds.Size(),
|
||||
format);
|
||||
|
||||
return mUpdateDrawTarget;;
|
||||
@ -525,7 +511,7 @@ TiledTextureImage::EndUpdate()
|
||||
int xPos = (i % mColumns) * mTileSize;
|
||||
int yPos = (i / mColumns) * mTileSize;
|
||||
nsIntRect imageRect = nsIntRect(nsIntPoint(xPos,yPos),
|
||||
ThebesIntSize(mImages[i]->GetSize()));
|
||||
mImages[i]->GetSize());
|
||||
|
||||
nsIntRegion subregion;
|
||||
subregion.And(mUpdateRegion, imageRect);
|
||||
|
@ -211,22 +211,10 @@ protected:
|
||||
* TextureImage from GLContext::CreateTextureImage(). That is,
|
||||
* clients must not be given partially-constructed TextureImages.
|
||||
*/
|
||||
TextureImage(const nsIntSize& aSize,
|
||||
GLenum aWrapMode, ContentType aContentType,
|
||||
Flags aFlags = NoFlags,
|
||||
ImageFormat aImageFormat = gfxImageFormat::Unknown)
|
||||
: mSize(aSize.ToIntSize())
|
||||
, mWrapMode(aWrapMode)
|
||||
, mContentType(aContentType)
|
||||
, mImageFormat(aImageFormat)
|
||||
, mFilter(GraphicsFilter::FILTER_GOOD)
|
||||
, mFlags(aFlags)
|
||||
{}
|
||||
|
||||
// Moz2D equivalent...
|
||||
TextureImage(const gfx::IntSize& aSize,
|
||||
GLenum aWrapMode, ContentType aContentType,
|
||||
Flags aFlags = NoFlags);
|
||||
Flags aFlags = NoFlags,
|
||||
ImageFormat aImageFormat = gfxImageFormat::Unknown);
|
||||
|
||||
// Protected destructor, to discourage deletion outside of Release():
|
||||
virtual ~TextureImage() {}
|
||||
@ -257,13 +245,6 @@ class BasicTextureImage
|
||||
public:
|
||||
virtual ~BasicTextureImage();
|
||||
|
||||
BasicTextureImage(GLuint aTexture,
|
||||
const nsIntSize& aSize,
|
||||
GLenum aWrapMode,
|
||||
ContentType aContentType,
|
||||
GLContext* aContext,
|
||||
TextureImage::Flags aFlags = TextureImage::NoFlags,
|
||||
TextureImage::ImageFormat aImageFormat = gfxImageFormat::Unknown);
|
||||
BasicTextureImage(GLuint aTexture,
|
||||
const gfx::IntSize& aSize,
|
||||
GLenum aWrapMode,
|
||||
|
@ -102,7 +102,7 @@ TextureImageEGL::GetUpdateRegion(nsIntRegion& aForRegion)
|
||||
if (mTextureState != Valid) {
|
||||
// if the texture hasn't been initialized yet, force the
|
||||
// client to paint everything
|
||||
aForRegion = nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize));
|
||||
aForRegion = nsIntRect(nsIntPoint(0, 0), mSize);
|
||||
}
|
||||
|
||||
// We can only draw a rectangle, not subregions due to
|
||||
@ -122,7 +122,7 @@ TextureImageEGL::BeginUpdate(nsIntRegion& aRegion)
|
||||
mUpdateRect = aRegion.GetBounds();
|
||||
|
||||
//printf_stderr("BeginUpdate with updateRect [%d %d %d %d]\n", mUpdateRect.x, mUpdateRect.y, mUpdateRect.width, mUpdateRect.height);
|
||||
if (!nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize)).Contains(mUpdateRect)) {
|
||||
if (!nsIntRect(nsIntPoint(0, 0), mSize).Contains(mUpdateRect)) {
|
||||
NS_ERROR("update outside of image");
|
||||
return nullptr;
|
||||
}
|
||||
@ -166,7 +166,7 @@ TextureImageEGL::EndUpdate()
|
||||
|
||||
if (mTextureState != Valid) {
|
||||
NS_ASSERTION(mUpdateRect.x == 0 && mUpdateRect.y == 0 &&
|
||||
mUpdateRect.Size() == gfx::ThebesIntSize(mSize),
|
||||
mUpdateRect.Size() == mSize,
|
||||
"Bad initial update on non-created texture!");
|
||||
|
||||
mGLContext->fTexImage2D(LOCAL_GL_TEXTURE_2D,
|
||||
|
@ -106,7 +106,6 @@
|
||||
*/
|
||||
|
||||
class nsIWidget;
|
||||
struct nsIntSize;
|
||||
class nsIntRegion;
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -33,7 +33,7 @@ void ImageLayer::ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSu
|
||||
// Snap image edges to pixel boundaries
|
||||
gfxRect sourceRect(0, 0, 0, 0);
|
||||
if (mContainer) {
|
||||
sourceRect.SizeTo(gfx::ThebesIntSize(mContainer->GetCurrentSize()));
|
||||
sourceRect.SizeTo(mContainer->GetCurrentSize());
|
||||
}
|
||||
// Snap our local transform first, and snap the inherited transform as well.
|
||||
// This makes our snapping equivalent to what would happen if our content
|
||||
|
@ -10,8 +10,6 @@
|
||||
#include <stdint.h>
|
||||
#include <mozilla/UniquePtr.h>
|
||||
|
||||
struct nsIntSize;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
namespace gl { class GLContext; }
|
||||
|
@ -164,15 +164,6 @@ AppendToString(std::stringstream& aStream, const EventRegions& e,
|
||||
aStream << "}" << sfx;
|
||||
}
|
||||
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, const nsIntSize& sz,
|
||||
const char* pfx, const char* sfx)
|
||||
{
|
||||
aStream << pfx;
|
||||
aStream << nsPrintfCString("(w=%d, h=%d)", sz.width, sz.height).get();
|
||||
aStream << sfx;
|
||||
}
|
||||
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, const FrameMetrics& m,
|
||||
const char* pfx, const char* sfx, bool detailed)
|
||||
|
@ -19,7 +19,6 @@
|
||||
struct gfxRGBA;
|
||||
struct nsIntPoint;
|
||||
struct nsIntRect;
|
||||
struct nsIntSize;
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
@ -133,10 +132,6 @@ void
|
||||
AppendToString(std::stringstream& aStream, const EventRegions& e,
|
||||
const char* pfx="", const char* sfx="");
|
||||
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, const nsIntSize& sz,
|
||||
const char* pfx="", const char* sfx="");
|
||||
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, const FrameMetrics& m,
|
||||
const char* pfx="", const char* sfx="", bool detailed = false);
|
||||
|
@ -21,8 +21,6 @@
|
||||
#include "nsRegion.h" // for nsIntRegion
|
||||
#include "LayersTypes.h"
|
||||
|
||||
struct nsIntSize;
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
class Matrix;
|
||||
@ -389,7 +387,7 @@ protected:
|
||||
* buffer provider.
|
||||
*/
|
||||
gfxContentType BufferContentType();
|
||||
bool BufferSizeOkFor(const nsIntSize& aSize);
|
||||
bool BufferSizeOkFor(const gfx::IntSize& aSize);
|
||||
/**
|
||||
* If the buffer hasn't been mapped, map it.
|
||||
*/
|
||||
|
@ -35,12 +35,12 @@ X11DataTextureSourceBasic::Update(gfx::DataSourceSurface* aSurface,
|
||||
|
||||
if (xrenderFormat) {
|
||||
surf = gfxXlibSurface::Create(screen, xrenderFormat,
|
||||
ThebesIntSize(aSurface->GetSize()));
|
||||
aSurface->GetSize());
|
||||
}
|
||||
|
||||
if (!surf) {
|
||||
NS_WARNING("Couldn't create native surface, fallback to image surface");
|
||||
surf = new gfxImageSurface(ThebesIntSize(aSurface->GetSize()), imageFormat);
|
||||
surf = new gfxImageSurface(aSurface->GetSize(), imageFormat);
|
||||
}
|
||||
|
||||
mBufferDrawTarget = gfxPlatform::GetPlatform()->
|
||||
|
@ -476,7 +476,7 @@ ClientLayerManager::MakeSnapshotIfRequired()
|
||||
|
||||
SurfaceDescriptor inSnapshot;
|
||||
if (!bounds.IsEmpty() &&
|
||||
mForwarder->AllocSurfaceDescriptor(bounds.Size().ToIntSize(),
|
||||
mForwarder->AllocSurfaceDescriptor(bounds.Size(),
|
||||
gfxContentType::COLOR_ALPHA,
|
||||
&inSnapshot) &&
|
||||
remoteRenderer->SendMakeSnapshot(inSnapshot, bounds)) {
|
||||
|
@ -59,8 +59,6 @@
|
||||
#include "TextRenderer.h" // for TextRenderer
|
||||
|
||||
class gfxContext;
|
||||
struct nsIntSize;
|
||||
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
@ -31,8 +31,6 @@
|
||||
#include "LayerTreeInvalidation.h"
|
||||
|
||||
class gfxContext;
|
||||
struct nsIntPoint;
|
||||
struct nsIntSize;
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include <windows.h>
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include "mozilla/layers/AtomicRefCountedWithFinalize.h"
|
||||
|
||||
class gfxReusableSurfaceWrapper;
|
||||
struct nsIntPoint;
|
||||
struct nsIntSize;
|
||||
struct nsIntRect;
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -34,7 +34,6 @@
|
||||
class gfxReusableSurfaceWrapper;
|
||||
struct nsIntPoint;
|
||||
struct nsIntRect;
|
||||
struct nsIntSize;
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
@ -309,7 +308,7 @@ private:
|
||||
const gfx::Rect& aClipRect,
|
||||
const nsIntRegion& aScreenRegion,
|
||||
const nsIntPoint& aTextureOffset,
|
||||
const nsIntSize& aTextureBounds);
|
||||
const gfx::IntSize& aTextureBounds);
|
||||
|
||||
void EnsureTileStore() {}
|
||||
|
||||
|
@ -1265,7 +1265,7 @@ CompositorD3D11::UpdateRenderTarget()
|
||||
}
|
||||
|
||||
mDefaultRT = new CompositingRenderTargetD3D11(backBuf, IntPoint(0, 0));
|
||||
mDefaultRT->SetSize(mSize.ToIntSize());
|
||||
mDefaultRT->SetSize(mSize);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -708,7 +708,7 @@ CairoTextureClientD3D9::BorrowDrawTarget()
|
||||
// Instead we have to use a gfxImageSurface and fallback for font drawing.
|
||||
D3DLOCKED_RECT rect;
|
||||
mD3D9Surface->LockRect(&rect, nullptr, 0);
|
||||
mSurface = new gfxImageSurface((uint8_t*)rect.pBits, ThebesIntSize(mSize),
|
||||
mSurface = new gfxImageSurface((uint8_t*)rect.pBits, mSize,
|
||||
rect.Pitch, SurfaceFormatToImageFormat(mFormat));
|
||||
mLockRect = true;
|
||||
}
|
||||
|
@ -5,7 +5,6 @@
|
||||
using struct gfxPoint from "gfxPoint.h";
|
||||
using struct nsIntRect from "nsRect.h";
|
||||
using nsIntRegion from "nsRegion.h";
|
||||
using struct nsIntSize from "nsSize.h";
|
||||
using struct mozilla::layers::MagicGrallocBufferHandle from "gfxipc/ShadowLayerUtils.h";
|
||||
using struct mozilla::layers::GrallocBufferRef from "gfxipc/ShadowLayerUtils.h";
|
||||
using struct mozilla::layers::SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h";
|
||||
|
@ -64,7 +64,7 @@ GetXRenderPictFormatFromId(Display* aDisplay, PictFormat aFormatId)
|
||||
|
||||
SurfaceDescriptorX11::SurfaceDescriptorX11(gfxXlibSurface* aSurf)
|
||||
: mId(aSurf->XDrawable())
|
||||
, mSize(aSurf->GetSize().ToIntSize())
|
||||
, mSize(aSurf->GetSize())
|
||||
{
|
||||
const XRenderPictFormat *pictFormat = aSurf->XRenderFormat();
|
||||
if (pictFormat) {
|
||||
@ -90,7 +90,7 @@ SurfaceDescriptorX11::OpenForeign() const
|
||||
nsRefPtr<gfxXlibSurface> surf;
|
||||
XRenderPictFormat* pictFormat = GetXRenderPictFormatFromId(display, mFormat);
|
||||
if (pictFormat) {
|
||||
surf = new gfxXlibSurface(screen, mId, pictFormat, gfx::ThebesIntSize(mSize));
|
||||
surf = new gfxXlibSurface(screen, mId, pictFormat, mSize);
|
||||
} else {
|
||||
Visual* visual;
|
||||
int depth;
|
||||
@ -98,7 +98,7 @@ SurfaceDescriptorX11::OpenForeign() const
|
||||
if (!visual)
|
||||
return nullptr;
|
||||
|
||||
surf = new gfxXlibSurface(display, mId, visual, gfx::ThebesIntSize(mSize));
|
||||
surf = new gfxXlibSurface(display, mId, visual, mSize);
|
||||
}
|
||||
return surf->CairoStatus() ? nullptr : surf.forget();
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ GrallocTextureHostOGL::GetRenderState()
|
||||
flags |= LayerRenderStateFlags::FORMAT_RB_SWAP;
|
||||
}
|
||||
return LayerRenderState(graphicBuffer,
|
||||
gfx::ThebesIntSize(mDescriptorSize),
|
||||
mDescriptorSize,
|
||||
flags,
|
||||
this);
|
||||
}
|
||||
|
@ -280,15 +280,15 @@ TextureImageTextureSourceOGL::EnsureBuffer(const nsIntSize& aSize,
|
||||
gfxContentType aContentType)
|
||||
{
|
||||
if (!mTexImage ||
|
||||
mTexImage->GetSize() != aSize.ToIntSize() ||
|
||||
mTexImage->GetSize() != aSize ||
|
||||
mTexImage->GetContentType() != aContentType) {
|
||||
mTexImage = CreateTextureImage(mCompositor->gl(),
|
||||
aSize.ToIntSize(),
|
||||
aSize,
|
||||
aContentType,
|
||||
LOCAL_GL_CLAMP_TO_EDGE,
|
||||
FlagsToGLFlags(mFlags));
|
||||
}
|
||||
mTexImage->Resize(aSize.ToIntSize());
|
||||
mTexImage->Resize(aSize);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -41,7 +41,6 @@ class gfxReusableSurfaceWrapper;
|
||||
class nsIntRegion;
|
||||
struct nsIntPoint;
|
||||
struct nsIntRect;
|
||||
struct nsIntSize;
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
@ -202,8 +201,8 @@ public:
|
||||
nsIntRegion* aDestRegion = nullptr,
|
||||
gfx::IntPoint* aSrcOffset = nullptr) override;
|
||||
|
||||
void EnsureBuffer(const nsIntSize& aSize,
|
||||
gfxContentType aContentType);
|
||||
void EnsureBuffer(const gfx::IntSize& aSize,
|
||||
gfxContentType aContentType);
|
||||
|
||||
void CopyTo(const nsIntRect& aSourceRect,
|
||||
DataTextureSource* aDest,
|
||||
|
@ -12,10 +12,10 @@
|
||||
#include "nsISupports.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsColor.h"
|
||||
#include "nsSize.h"
|
||||
|
||||
struct nsRect;
|
||||
struct nsIntRect;
|
||||
struct nsIntSize;
|
||||
class nsIntRegion;
|
||||
struct nsFont;
|
||||
struct nsIntMargin;
|
||||
|
@ -13,7 +13,7 @@
|
||||
// Maximum allowable size
|
||||
#define NS_MAXSIZE nscoord_MAX
|
||||
|
||||
struct nsIntSize;
|
||||
typedef mozilla::gfx::IntSize nsIntSize;
|
||||
typedef nsIntSize gfxIntSize;
|
||||
|
||||
struct nsSize : public mozilla::gfx::BaseSize<nscoord, nsSize> {
|
||||
@ -35,19 +35,6 @@ struct nsSize : public mozilla::gfx::BaseSize<nscoord, nsSize> {
|
||||
ScaleToOtherAppUnits(int32_t aFromAPP, int32_t aToAPP) const;
|
||||
};
|
||||
|
||||
struct nsIntSize : public mozilla::gfx::BaseSize<int32_t, nsIntSize> {
|
||||
typedef mozilla::gfx::BaseSize<int32_t, nsIntSize> Super;
|
||||
|
||||
nsIntSize() : Super() {}
|
||||
nsIntSize(int32_t aWidth, int32_t aHeight) : Super(aWidth, aHeight) {}
|
||||
|
||||
inline nsSize ToAppUnits(nscoord aAppUnitsPerPixel) const;
|
||||
mozilla::gfx::IntSize ToIntSize() const
|
||||
{
|
||||
return mozilla::gfx::IntSize(width, height);
|
||||
};
|
||||
};
|
||||
|
||||
inline nsIntSize
|
||||
nsSize::ScaleToNearestPixels(float aXScale, float aYScale,
|
||||
nscoord aAppUnitsPerPixel) const
|
||||
@ -75,10 +62,10 @@ nsSize::ScaleToOtherAppUnits(int32_t aFromAPP, int32_t aToAPP) const {
|
||||
}
|
||||
|
||||
inline nsSize
|
||||
nsIntSize::ToAppUnits(nscoord aAppUnitsPerPixel) const
|
||||
IntSizeToAppUnits(mozilla::gfx::IntSize aSize, nscoord aAppUnitsPerPixel)
|
||||
{
|
||||
return nsSize(NSIntPixelsToAppUnits(width, aAppUnitsPerPixel),
|
||||
NSIntPixelsToAppUnits(height, aAppUnitsPerPixel));
|
||||
return nsSize(NSIntPixelsToAppUnits(aSize.width, aAppUnitsPerPixel),
|
||||
NSIntPixelsToAppUnits(aSize.height, aAppUnitsPerPixel));
|
||||
}
|
||||
|
||||
#endif /* NSSIZE_H */
|
||||
|
@ -189,7 +189,7 @@ void TestTextureClientSurface(TextureClient* texture, gfxImageSurface* surface)
|
||||
|
||||
nsRefPtr<gfxImageSurface> hostSurface =
|
||||
new gfxImageSurface(hostDataSurface->GetData(),
|
||||
ThebesIntSize(hostDataSurface->GetSize()),
|
||||
hostDataSurface->GetSize(),
|
||||
hostDataSurface->Stride(),
|
||||
SurfaceFormatToImageFormat(hostDataSurface->GetFormat()));
|
||||
AssertSurfacesEqual(surface, hostSurface.get());
|
||||
@ -297,9 +297,9 @@ TEST(Layers, TextureYCbCrSerialization) {
|
||||
clientData.mYChannel = ySurface->Data();
|
||||
clientData.mCbChannel = cbSurface->Data();
|
||||
clientData.mCrChannel = crSurface->Data();
|
||||
clientData.mYSize = ySurface->GetSize().ToIntSize();
|
||||
clientData.mPicSize = ySurface->GetSize().ToIntSize();
|
||||
clientData.mCbCrSize = cbSurface->GetSize().ToIntSize();
|
||||
clientData.mYSize = ySurface->GetSize();
|
||||
clientData.mPicSize = ySurface->GetSize();
|
||||
clientData.mCbCrSize = cbSurface->GetSize();
|
||||
clientData.mYStride = ySurface->Stride();
|
||||
clientData.mCbCrStride = cbSurface->Stride();
|
||||
clientData.mStereoMode = StereoMode::MONO;
|
||||
|
@ -157,11 +157,6 @@ inline gfxSize ThebesSize(const Size &aSize)
|
||||
return gfxSize(aSize.width, aSize.height);
|
||||
}
|
||||
|
||||
inline gfxIntSize ThebesIntSize(const IntSize &aSize)
|
||||
{
|
||||
return gfxIntSize(aSize.width, aSize.height);
|
||||
}
|
||||
|
||||
inline gfxRect ThebesRect(const Rect &aRect)
|
||||
{
|
||||
return gfxRect(aRect.x, aRect.y, aRect.width, aRect.height);
|
||||
|
@ -132,8 +132,7 @@ gfxAndroidPlatform::CreateOffscreenSurface(const IntSize& size,
|
||||
gfxContentType contentType)
|
||||
{
|
||||
nsRefPtr<gfxASurface> newSurface;
|
||||
newSurface = new gfxImageSurface(ThebesIntSize(size),
|
||||
OptimalFormatForContent(contentType));
|
||||
newSurface = new gfxImageSurface(size, OptimalFormatForContent(contentType));
|
||||
|
||||
return newSurface.forget();
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ gfxCallbackDrawable::MakeSurfaceDrawable(const GraphicsFilter aFilter)
|
||||
SurfaceFormat format =
|
||||
gfxPlatform::GetPlatform()->Optimal2DFormatForContent(gfxContentType::COLOR_ALPHA);
|
||||
RefPtr<DrawTarget> dt =
|
||||
gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(mSize.ToIntSize(),
|
||||
gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(mSize,
|
||||
format);
|
||||
if (!dt)
|
||||
return nullptr;
|
||||
|
@ -104,12 +104,12 @@ gfxPlatformGtk::CreateOffscreenSurface(const IntSize& size,
|
||||
|
||||
if (xrenderFormat) {
|
||||
newSurface = gfxXlibSurface::Create(screen, xrenderFormat,
|
||||
ThebesIntSize(size));
|
||||
size);
|
||||
}
|
||||
} else {
|
||||
// We're not going to use XRender, so we don't need to
|
||||
// search for a render format
|
||||
newSurface = new gfxImageSurface(ThebesIntSize(size), imageFormat);
|
||||
newSurface = new gfxImageSurface(size, imageFormat);
|
||||
// The gfxImageSurface ctor zeroes this for us, no need to
|
||||
// waste time clearing again
|
||||
needsClear = false;
|
||||
@ -121,7 +121,7 @@ gfxPlatformGtk::CreateOffscreenSurface(const IntSize& size,
|
||||
// We couldn't create a native surface for whatever reason;
|
||||
// e.g., no display, no RENDER, bad size, etc.
|
||||
// Fall back to image surface for the data.
|
||||
newSurface = new gfxImageSurface(ThebesIntSize(size), imageFormat);
|
||||
newSurface = new gfxImageSurface(size, imageFormat);
|
||||
}
|
||||
|
||||
if (newSurface->CairoStatus()) {
|
||||
|
@ -116,8 +116,7 @@ gfxPlatformMac::CreateOffscreenSurface(const IntSize& size,
|
||||
gfxContentType contentType)
|
||||
{
|
||||
nsRefPtr<gfxASurface> newSurface =
|
||||
new gfxQuartzSurface(ThebesIntSize(size),
|
||||
OptimalFormatForContent(contentType));
|
||||
new gfxQuartzSurface(size, OptimalFormatForContent(contentType));
|
||||
return newSurface.forget();
|
||||
}
|
||||
|
||||
|
@ -773,18 +773,18 @@ gfxWindowsPlatform::CreateOffscreenSurface(const IntSize& size,
|
||||
|
||||
#ifdef CAIRO_HAS_WIN32_SURFACE
|
||||
if (mRenderMode == RENDER_GDI)
|
||||
surf = new gfxWindowsSurface(ThebesIntSize(size),
|
||||
surf = new gfxWindowsSurface(size,
|
||||
OptimalFormatForContent(contentType));
|
||||
#endif
|
||||
|
||||
#ifdef CAIRO_HAS_D2D_SURFACE
|
||||
if (mRenderMode == RENDER_DIRECT2D)
|
||||
surf = new gfxD2DSurface(ThebesIntSize(size),
|
||||
surf = new gfxD2DSurface(size,
|
||||
OptimalFormatForContent(contentType));
|
||||
#endif
|
||||
|
||||
if (!surf || surf->CairoStatus()) {
|
||||
surf = new gfxImageSurface(ThebesIntSize(size),
|
||||
surf = new gfxImageSurface(size,
|
||||
OptimalFormatForContent(contentType));
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,6 @@ class gfxASurface;
|
||||
class gfxContext;
|
||||
struct nsIntRect;
|
||||
struct nsIntPoint;
|
||||
struct nsIntSize;
|
||||
typedef struct _cairo cairo_t;
|
||||
typedef struct _cairo_surface cairo_surface_t;
|
||||
|
||||
@ -82,18 +81,18 @@ public:
|
||||
* successful, a pointer to the new gfxASurface is stored in *resultSurface,
|
||||
* otherwise *resultSurface is set to nullptr.
|
||||
*/
|
||||
void Draw(gfxContext* ctx, nsIntSize size,
|
||||
void Draw(gfxContext* ctx, mozilla::gfx::IntSize size,
|
||||
uint32_t flags, Screen *screen, Visual *visual);
|
||||
|
||||
private:
|
||||
bool DrawDirect(gfxContext *ctx, nsIntSize bounds,
|
||||
bool DrawDirect(gfxContext *ctx, mozilla::gfx::IntSize bounds,
|
||||
uint32_t flags, Screen *screen, Visual *visual);
|
||||
|
||||
bool DrawCairo(cairo_t* cr, nsIntSize size,
|
||||
bool DrawCairo(cairo_t* cr, mozilla::gfx::IntSize size,
|
||||
uint32_t flags, Screen *screen, Visual *visual);
|
||||
|
||||
void DrawFallback(mozilla::gfx::DrawTarget* dt, gfxContext* ctx,
|
||||
gfxASurface* aSurface, nsIntSize& size,
|
||||
gfxASurface* aSurface, mozilla::gfx::IntSize& size,
|
||||
nsIntRect& drawingRect, bool canDrawOverBackground,
|
||||
uint32_t flags, Screen* screen, Visual* visual);
|
||||
|
||||
|
@ -436,7 +436,7 @@ Decoder::EnsureFrame(uint32_t aFrameNum,
|
||||
MOZ_ASSERT(ref, "No ref to current frame?");
|
||||
|
||||
// Reinitialize the old frame.
|
||||
nsIntSize oldSize = ThebesIntSize(aPreviousFrame->GetImageSize());
|
||||
nsIntSize oldSize = aPreviousFrame->GetImageSize();
|
||||
bool nonPremult =
|
||||
aDecodeFlags & imgIContainer::FLAG_DECODE_NO_PREMULTIPLY_ALPHA;
|
||||
if (NS_FAILED(aPreviousFrame->ReinitForDecoder(oldSize, aFrameRect, aFormat,
|
||||
@ -470,7 +470,7 @@ Decoder::InternalAddFrame(uint32_t aFrameNum,
|
||||
return RawAccessFrameRef();
|
||||
}
|
||||
|
||||
if (!SurfaceCache::CanHold(aTargetSize.ToIntSize())) {
|
||||
if (!SurfaceCache::CanHold(aTargetSize)) {
|
||||
NS_WARNING("Trying to add frame that's too large for the SurfaceCache");
|
||||
return RawAccessFrameRef();
|
||||
}
|
||||
@ -492,7 +492,7 @@ Decoder::InternalAddFrame(uint32_t aFrameNum,
|
||||
|
||||
InsertOutcome outcome =
|
||||
SurfaceCache::Insert(frame, ImageKey(mImage.get()),
|
||||
RasterSurfaceKey(aTargetSize.ToIntSize(),
|
||||
RasterSurfaceKey(aTargetSize,
|
||||
aDecodeFlags,
|
||||
aFrameNum),
|
||||
Lifetime::Persistent);
|
||||
|
@ -444,7 +444,7 @@ FrameAnimator::DoBlend(nsIntRect* aDirtyRect,
|
||||
// Create the Compositing Frame
|
||||
if (!mCompositingFrame) {
|
||||
nsRefPtr<imgFrame> newFrame = new imgFrame;
|
||||
nsresult rv = newFrame->InitForDecoder(ThebesIntSize(mSize),
|
||||
nsresult rv = newFrame->InitForDecoder(mSize,
|
||||
SurfaceFormat::B8G8R8A8);
|
||||
if (NS_FAILED(rv)) {
|
||||
mCompositingFrame.reset();
|
||||
@ -584,7 +584,7 @@ FrameAnimator::DoBlend(nsIntRect* aDirtyRect,
|
||||
// overwrite.
|
||||
if (!mCompositingPrevFrame) {
|
||||
nsRefPtr<imgFrame> newFrame = new imgFrame;
|
||||
nsresult rv = newFrame->InitForDecoder(ThebesIntSize(mSize),
|
||||
nsresult rv = newFrame->InitForDecoder(mSize,
|
||||
SurfaceFormat::B8G8R8A8);
|
||||
if (NS_FAILED(rv)) {
|
||||
mCompositingPrevFrame.reset();
|
||||
|
@ -161,7 +161,7 @@ public:
|
||||
// Insert the new surface into the cache immediately. We need to do this so
|
||||
// that we won't start multiple scaling jobs for the same size.
|
||||
SurfaceCache::Insert(mDstRef.get(), ImageKey(mImage.get()),
|
||||
RasterSurfaceKey(mDstSize.ToIntSize(), mImageFlags, 0),
|
||||
RasterSurfaceKey(mDstSize, mImageFlags, 0),
|
||||
Lifetime::Transient);
|
||||
|
||||
return true;
|
||||
@ -210,7 +210,7 @@ public:
|
||||
|
||||
// Remove the frame from the cache since we know we don't need it.
|
||||
SurfaceCache::RemoveSurface(ImageKey(mImage.get()),
|
||||
RasterSurfaceKey(mDstSize.ToIntSize(),
|
||||
RasterSurfaceKey(mDstSize,
|
||||
mImageFlags, 0));
|
||||
|
||||
// Release everything we're holding, too.
|
||||
@ -504,8 +504,7 @@ RasterImage::LookupFrame(uint32_t aFrameNum,
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
IntSize requestedSize = CanDownscaleDuringDecode(aSize, aFlags)
|
||||
? aSize.ToIntSize()
|
||||
: mSize.ToIntSize();
|
||||
? aSize : mSize;
|
||||
|
||||
DrawableFrameRef ref = LookupFrameInternal(aFrameNum, requestedSize, aFlags);
|
||||
|
||||
@ -518,7 +517,7 @@ RasterImage::LookupFrame(uint32_t aFrameNum,
|
||||
// The OS threw this frame away. We need to redecode if we can.
|
||||
MOZ_ASSERT(!mAnim, "Animated frames should be locked");
|
||||
|
||||
Decode(Some(ThebesIntSize(requestedSize)), aFlags);
|
||||
Decode(Some(requestedSize), aFlags);
|
||||
|
||||
// If we can sync decode, we should already have the frame.
|
||||
if (aFlags & FLAG_SYNC_DECODE) {
|
||||
@ -935,7 +934,7 @@ RasterImage::OnAddedFrame(uint32_t aNewFrameCount,
|
||||
if (aNewFrameCount == 2) {
|
||||
// We're becoming animated, so initialize animation stuff.
|
||||
MOZ_ASSERT(!mAnim, "Already have animation state?");
|
||||
mAnim = MakeUnique<FrameAnimator>(this, mSize.ToIntSize(), mAnimationMode);
|
||||
mAnim = MakeUnique<FrameAnimator>(this, mSize, mAnimationMode);
|
||||
|
||||
// We don't support discarding animated images (See bug 414259).
|
||||
// Lock the image and throw away the key.
|
||||
@ -1612,7 +1611,7 @@ RasterImage::CanScale(GraphicsFilter aFilter,
|
||||
}
|
||||
|
||||
// There's no point in scaling if we can't store the result.
|
||||
if (!SurfaceCache::CanHold(aSize.ToIntSize())) {
|
||||
if (!SurfaceCache::CanHold(aSize)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1654,7 +1653,7 @@ RasterImage::CanDownscaleDuringDecode(const nsIntSize& aSize, uint32_t aFlags)
|
||||
}
|
||||
|
||||
// There's no point in scaling if we can't store the result.
|
||||
if (!SurfaceCache::CanHold(aSize.ToIntSize())) {
|
||||
if (!SurfaceCache::CanHold(aSize)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1715,7 +1714,7 @@ RasterImage::DrawWithPreDownscaleIfNeeded(DrawableFrameRef&& aFrameRef,
|
||||
if (CanScale(aFilter, aSize, aFlags)) {
|
||||
frameRef =
|
||||
SurfaceCache::Lookup(ImageKey(this),
|
||||
RasterSurfaceKey(aSize.ToIntSize(),
|
||||
RasterSurfaceKey(aSize,
|
||||
DecodeFlags(aFlags),
|
||||
0));
|
||||
if (!frameRef) {
|
||||
@ -1743,7 +1742,7 @@ RasterImage::DrawWithPreDownscaleIfNeeded(DrawableFrameRef&& aFrameRef,
|
||||
// adjust the drawing parameters accordingly.
|
||||
IntSize finalSize = frameRef->GetImageSize();
|
||||
bool couldRedecodeForBetterFrame = false;
|
||||
if (ThebesIntSize(finalSize) != aSize) {
|
||||
if (finalSize != aSize) {
|
||||
gfx::Size scale(double(aSize.width) / finalSize.width,
|
||||
double(aSize.height) / finalSize.height);
|
||||
aContext->Multiply(gfxMatrix::Scaling(scale.width, scale.height));
|
||||
@ -2096,7 +2095,7 @@ RasterImage::OptimalImageSizeForDest(const gfxSize& aDest, uint32_t aWhichFrame,
|
||||
} else if (CanScale(aFilter, destSize, aFlags)) {
|
||||
DrawableFrameRef frameRef =
|
||||
SurfaceCache::Lookup(ImageKey(this),
|
||||
RasterSurfaceKey(destSize.ToIntSize(),
|
||||
RasterSurfaceKey(destSize,
|
||||
DecodeFlags(aFlags),
|
||||
0));
|
||||
|
||||
|
@ -15,13 +15,13 @@
|
||||
#include "nsIObserver.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsSize.h"
|
||||
|
||||
class nsIAtom;
|
||||
class nsIPresShell;
|
||||
class nsIRequest;
|
||||
class nsILoadGroup;
|
||||
class nsIFrame;
|
||||
struct nsIntSize;
|
||||
|
||||
#define OBSERVER_SVC_CID "@mozilla.org/observer-service;1"
|
||||
|
||||
|
@ -807,7 +807,7 @@ VectorImage::Draw(gfxContext* aContext,
|
||||
RefPtr<SourceSurface> surface = frameRef->GetSurface();
|
||||
if (surface) {
|
||||
nsRefPtr<gfxDrawable> svgDrawable =
|
||||
new gfxSurfaceDrawable(surface, ThebesIntSize(frameRef->GetSize()));
|
||||
new gfxSurfaceDrawable(surface, frameRef->GetSize());
|
||||
Show(svgDrawable, params);
|
||||
return DrawResult::SUCCESS;
|
||||
}
|
||||
@ -834,7 +834,7 @@ VectorImage::CreateSurfaceAndShow(const SVGDrawingParameters& aParams)
|
||||
aParams.flags);
|
||||
|
||||
nsRefPtr<gfxDrawable> svgDrawable =
|
||||
new gfxCallbackDrawable(cb, ThebesIntSize(aParams.size));
|
||||
new gfxCallbackDrawable(cb, aParams.size);
|
||||
|
||||
bool bypassCache = bool(aParams.flags & FLAG_BYPASS_SURFACE_CACHE) ||
|
||||
// Refuse to cache animated images:
|
||||
@ -857,7 +857,7 @@ VectorImage::CreateSurfaceAndShow(const SVGDrawingParameters& aParams)
|
||||
// our gfxDrawable into it. (We use FILTER_NEAREST since we never scale here.)
|
||||
nsRefPtr<imgFrame> frame = new imgFrame;
|
||||
nsresult rv =
|
||||
frame->InitWithDrawable(svgDrawable, ThebesIntSize(aParams.size),
|
||||
frame->InitWithDrawable(svgDrawable, aParams.size,
|
||||
SurfaceFormat::B8G8R8A8,
|
||||
GraphicsFilter::FILTER_NEAREST, aParams.flags);
|
||||
|
||||
@ -882,7 +882,7 @@ VectorImage::CreateSurfaceAndShow(const SVGDrawingParameters& aParams)
|
||||
|
||||
// Draw.
|
||||
nsRefPtr<gfxDrawable> drawable =
|
||||
new gfxSurfaceDrawable(surface, ThebesIntSize(aParams.size));
|
||||
new gfxSurfaceDrawable(surface, aParams.size);
|
||||
Show(drawable, aParams);
|
||||
|
||||
// Send out an invalidation so that surfaces that are still in use get
|
||||
@ -897,7 +897,7 @@ VectorImage::Show(gfxDrawable* aDrawable, const SVGDrawingParameters& aParams)
|
||||
{
|
||||
MOZ_ASSERT(aDrawable, "Should have a gfxDrawable by now");
|
||||
gfxUtils::DrawPixelSnapped(aParams.context, aDrawable,
|
||||
ThebesIntSize(aParams.size),
|
||||
aParams.size,
|
||||
aParams.region,
|
||||
SurfaceFormat::B8G8R8A8,
|
||||
aParams.filter, aParams.flags, aParams.opacity);
|
||||
|
@ -254,7 +254,7 @@ imgFrame::InitForDecoder(const nsIntSize& aImageSize,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
mImageSize = aImageSize.ToIntSize();
|
||||
mImageSize = aImageSize;
|
||||
mOffset.MoveTo(aRect.x, aRect.y);
|
||||
mSize.SizeTo(aRect.width, aRect.height);
|
||||
|
||||
@ -319,7 +319,7 @@ imgFrame::InitWithDrawable(gfxDrawable* aDrawable,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
mImageSize = aSize.ToIntSize();
|
||||
mImageSize = aSize;
|
||||
mOffset.MoveTo(0, 0);
|
||||
mSize.SizeTo(aSize.width, aSize.height);
|
||||
|
||||
@ -374,7 +374,7 @@ imgFrame::InitWithDrawable(gfxDrawable* aDrawable,
|
||||
// Draw using the drawable the caller provided.
|
||||
nsIntRect imageRect(0, 0, mSize.width, mSize.height);
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(target);
|
||||
gfxUtils::DrawPixelSnapped(ctx, aDrawable, ThebesIntSize(mSize),
|
||||
gfxUtils::DrawPixelSnapped(ctx, aDrawable, mSize,
|
||||
ImageRegion::Create(imageRect),
|
||||
mFormat, aFilter, aImageFlags);
|
||||
|
||||
@ -557,7 +557,7 @@ imgFrame::SurfaceForDrawing(bool aDoPadding,
|
||||
IntSize size(int32_t(aImageRect.Width()), int32_t(aImageRect.Height()));
|
||||
if (!aDoPadding && !aDoPartialDecode) {
|
||||
NS_ASSERTION(!mSinglePixel, "This should already have been handled");
|
||||
return SurfaceWithFormat(new gfxSurfaceDrawable(aSurface, ThebesIntSize(size)), mFormat);
|
||||
return SurfaceWithFormat(new gfxSurfaceDrawable(aSurface, size), mFormat);
|
||||
}
|
||||
|
||||
gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height);
|
||||
@ -585,7 +585,7 @@ imgFrame::SurfaceForDrawing(bool aDoPadding,
|
||||
}
|
||||
|
||||
RefPtr<SourceSurface> newsurf = target->Snapshot();
|
||||
return SurfaceWithFormat(new gfxSurfaceDrawable(newsurf, ThebesIntSize(size)), target->GetFormat());
|
||||
return SurfaceWithFormat(new gfxSurfaceDrawable(newsurf, size), target->GetFormat());
|
||||
}
|
||||
|
||||
// Not tiling, and we have a surface, so we can account for
|
||||
|
@ -488,7 +488,7 @@ CreatePrototypeObjectForComplexTypeInstance(JSContext* cx, HandleObject ctorProt
|
||||
if (!ctorPrototypePrototype)
|
||||
return nullptr;
|
||||
|
||||
return NewObjectWithProto<TypedProto>(cx, ctorPrototypePrototype, TenuredObject);
|
||||
return NewObjectWithProto<TypedProto>(cx, ctorPrototypePrototype, SingletonObject);
|
||||
}
|
||||
|
||||
const Class ArrayTypeDescr::class_ = {
|
||||
@ -1670,45 +1670,40 @@ OutlineTypedObject::obj_trace(JSTracer* trc, JSObject* object)
|
||||
}
|
||||
|
||||
bool
|
||||
TypedObject::obj_lookupProperty(JSContext* cx, HandleObject obj, HandleId id,
|
||||
MutableHandleObject objp, MutableHandleShape propp)
|
||||
TypeDescr::hasProperty(const JSAtomState& names, jsid id)
|
||||
{
|
||||
MOZ_ASSERT(obj->is<TypedObject>());
|
||||
|
||||
Rooted<TypeDescr*> descr(cx, &obj->as<TypedObject>().typeDescr());
|
||||
switch (descr->kind()) {
|
||||
switch (kind()) {
|
||||
case type::Scalar:
|
||||
case type::Reference:
|
||||
case type::Simd:
|
||||
break;
|
||||
return false;
|
||||
|
||||
case type::Array:
|
||||
{
|
||||
uint32_t index;
|
||||
if (IdIsIndex(id, &index))
|
||||
return obj_lookupElement(cx, obj, index, objp, propp);
|
||||
|
||||
if (JSID_IS_ATOM(id, cx->names().length)) {
|
||||
MarkNonNativePropertyFound<CanGC>(propp);
|
||||
objp.set(obj);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return IdIsIndex(id, &index) || JSID_IS_ATOM(id, names.length);
|
||||
}
|
||||
|
||||
case type::Struct:
|
||||
{
|
||||
StructTypeDescr& structDescr = descr->as<StructTypeDescr>();
|
||||
size_t index;
|
||||
if (structDescr.fieldIndex(id, &index)) {
|
||||
MarkNonNativePropertyFound<CanGC>(propp);
|
||||
objp.set(obj);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
return as<StructTypeDescr>().fieldIndex(id, &index);
|
||||
}
|
||||
}
|
||||
|
||||
MOZ_CRASH("Unexpected kind");
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
TypedObject::obj_lookupProperty(JSContext* cx, HandleObject obj, HandleId id,
|
||||
MutableHandleObject objp, MutableHandleShape propp)
|
||||
{
|
||||
if (obj->as<TypedObject>().typeDescr().hasProperty(cx->names(), id)) {
|
||||
MarkNonNativePropertyFound<CanGC>(propp);
|
||||
objp.set(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
RootedObject proto(cx, obj->getProto());
|
||||
if (!proto) {
|
||||
objp.set(nullptr);
|
||||
@ -1719,16 +1714,6 @@ TypedObject::obj_lookupProperty(JSContext* cx, HandleObject obj, HandleId id,
|
||||
return LookupProperty(cx, proto, id, objp, propp);
|
||||
}
|
||||
|
||||
bool
|
||||
TypedObject::obj_lookupElement(JSContext* cx, HandleObject obj, uint32_t index,
|
||||
MutableHandleObject objp, MutableHandleShape propp)
|
||||
{
|
||||
MOZ_ASSERT(obj->is<TypedObject>());
|
||||
MarkNonNativePropertyFound<CanGC>(propp);
|
||||
objp.set(obj);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
ReportPropertyError(JSContext* cx,
|
||||
const unsigned errorNumber,
|
||||
|
@ -174,6 +174,9 @@ class TypeDescr : public NativeObject
|
||||
return getReservedSlot(JS_DESCR_SLOT_SIZE).toInt32();
|
||||
}
|
||||
|
||||
// Whether id is an 'own' property of objects with this descriptor.
|
||||
bool hasProperty(const JSAtomState& names, jsid id);
|
||||
|
||||
// Type descriptors may contain a list of their references for use during
|
||||
// scanning. Marking code is optimized to use this list to mark inline
|
||||
// typed objects, rather than the slower trace hook. This list is only
|
||||
@ -525,9 +528,6 @@ class TypedObject : public JSObject
|
||||
HandleId id, MutableHandleObject objp,
|
||||
MutableHandleShape propp);
|
||||
|
||||
static bool obj_lookupElement(JSContext* cx, HandleObject obj, uint32_t index,
|
||||
MutableHandleObject objp, MutableHandleShape propp);
|
||||
|
||||
static bool obj_defineProperty(JSContext* cx, HandleObject obj, HandleId id,
|
||||
Handle<JSPropertyDescriptor> desc,
|
||||
ObjectOpResult& result);
|
||||
|
@ -3294,8 +3294,6 @@ EffectlesslyLookupProperty(JSContext* cx, HandleObject obj, HandlePropertyName n
|
||||
checkObj = GetDOMProxyProto(obj);
|
||||
if (!checkObj)
|
||||
return true;
|
||||
} else if (!obj->isNative() && !obj->is<UnboxedPlainObject>()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (LookupPropertyPure(cx, checkObj, NameToId(name), holder.address(), shape.address()))
|
||||
@ -3322,13 +3320,17 @@ CheckHasNoSuchProperty(JSContext* cx, HandleObject obj, HandlePropertyName name,
|
||||
|
||||
if (curObj->as<NativeObject>().contains(cx, NameToId(name)))
|
||||
return false;
|
||||
} else if (curObj != obj) {
|
||||
// Non-native objects are only handled as the original receiver.
|
||||
return false;
|
||||
} else if (curObj->is<UnboxedPlainObject>()) {
|
||||
if (curObj->as<UnboxedPlainObject>().containsUnboxedOrExpandoProperty(cx, NameToId(name)))
|
||||
return false;
|
||||
} else if (curObj->is<TypedObject>()) {
|
||||
if (curObj->as<TypedObject>().typeDescr().hasProperty(cx->names(), NameToId(name)))
|
||||
return false;
|
||||
} else {
|
||||
// Handle unboxed plain objects as the original receiver.
|
||||
if (!curObj->is<UnboxedPlainObject>() || curObj != obj)
|
||||
return false;
|
||||
|
||||
if (curObj->as<UnboxedPlainObject>().layout().lookup(name))
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
JSObject* proto = curObj->getTaggedProto().toObjectOrNull();
|
||||
@ -3350,7 +3352,7 @@ IsCacheableProtoChain(JSObject* obj, JSObject* holder, bool isDOMProxy=false)
|
||||
MOZ_ASSERT_IF(isDOMProxy, IsCacheableDOMProxy(obj));
|
||||
|
||||
if (!isDOMProxy && !obj->isNative()) {
|
||||
if (!obj->is<UnboxedPlainObject>() || obj == holder)
|
||||
if (obj == holder || !obj->is<UnboxedPlainObject>() || !obj->is<TypedObject>())
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -6598,7 +6600,7 @@ TryAttachNativeGetPropStub(JSContext* cx, HandleScript script, jsbytecode* pc,
|
||||
}
|
||||
|
||||
const Class* outerClass = nullptr;
|
||||
if (!isDOMProxy && !obj->isNative() && !obj->is<UnboxedPlainObject>()) {
|
||||
if (!isDOMProxy && !obj->isNative()) {
|
||||
outerClass = obj->getClass();
|
||||
DebugOnly<JSObject*> outer = obj.get();
|
||||
obj = GetInnerObject(obj);
|
||||
@ -7213,9 +7215,9 @@ ICGetPropNativeCompiler::getStub(ICStubSpace* space)
|
||||
}
|
||||
|
||||
static void
|
||||
GuardNativeOrUnboxedReceiver(MacroAssembler& masm, ReceiverGuard::StackGuard guard,
|
||||
Register object, Register scratch,
|
||||
size_t receiverGuardOffset, Label* failure)
|
||||
GuardReceiverObject(MacroAssembler& masm, ReceiverGuard::StackGuard guard,
|
||||
Register object, Register scratch,
|
||||
size_t receiverGuardOffset, Label* failure)
|
||||
{
|
||||
Address groupAddress(BaselineStubReg, receiverGuardOffset + ReceiverGuard::offsetOfGroup());
|
||||
Address shapeAddress(BaselineStubReg, receiverGuardOffset + ReceiverGuard::offsetOfShape());
|
||||
@ -7270,8 +7272,8 @@ ICGetPropNativeCompiler::generateStubCode(MacroAssembler& masm)
|
||||
Register scratch = regs.takeAnyExcluding(BaselineTailCallReg);
|
||||
|
||||
// Shape/group guard.
|
||||
GuardNativeOrUnboxedReceiver(masm, ReceiverGuard::StackGuard(obj_), objReg, scratch,
|
||||
ICGetPropNativeStub::offsetOfReceiverGuard(), &failure);
|
||||
GuardReceiverObject(masm, ReceiverGuard::StackGuard(obj_), objReg, scratch,
|
||||
ICGetPropNativeStub::offsetOfReceiverGuard(), &failure);
|
||||
|
||||
Register holderReg;
|
||||
if (obj_ == holder_) {
|
||||
@ -7418,8 +7420,8 @@ ICGetPropNativeDoesNotExistCompiler::generateStubCode(MacroAssembler& masm)
|
||||
|
||||
// Unbox and guard against old shape/group.
|
||||
Register objReg = masm.extractObject(R0, ExtractTemp0);
|
||||
GuardNativeOrUnboxedReceiver(masm, ReceiverGuard::StackGuard(obj_), objReg, scratch,
|
||||
ICGetProp_NativeDoesNotExist::offsetOfGuard(), &failure);
|
||||
GuardReceiverObject(masm, ReceiverGuard::StackGuard(obj_), objReg, scratch,
|
||||
ICGetProp_NativeDoesNotExist::offsetOfGuard(), &failure);
|
||||
|
||||
Register protoReg = regs.takeAny();
|
||||
// Check the proto chain.
|
||||
@ -7457,8 +7459,8 @@ ICGetProp_CallScripted::Compiler::generateStubCode(MacroAssembler& masm)
|
||||
|
||||
// Unbox and shape guard.
|
||||
Register objReg = masm.extractObject(R0, ExtractTemp0);
|
||||
GuardNativeOrUnboxedReceiver(masm, ReceiverGuard::StackGuard(receiver_), objReg, scratch,
|
||||
ICGetProp_CallScripted::offsetOfReceiverGuard(), &failure);
|
||||
GuardReceiverObject(masm, ReceiverGuard::StackGuard(receiver_), objReg, scratch,
|
||||
ICGetProp_CallScripted::offsetOfReceiverGuard(), &failure);
|
||||
|
||||
if (receiver_ != holder_) {
|
||||
Register holderReg = regs.takeAny();
|
||||
@ -7565,8 +7567,8 @@ ICGetProp_CallNative::Compiler::generateStubCode(MacroAssembler& masm)
|
||||
Register scratch = regs.takeAnyExcluding(BaselineTailCallReg);
|
||||
|
||||
// Shape guard.
|
||||
GuardNativeOrUnboxedReceiver(masm, ReceiverGuard::StackGuard(receiver_), objReg, scratch,
|
||||
ICGetProp_CallNative::offsetOfReceiverGuard(), &failure);
|
||||
GuardReceiverObject(masm, ReceiverGuard::StackGuard(receiver_), objReg, scratch,
|
||||
ICGetProp_CallNative::offsetOfReceiverGuard(), &failure);
|
||||
|
||||
if (receiver_ != holder_ ) {
|
||||
Register holderReg = regs.takeAny();
|
||||
@ -8894,8 +8896,8 @@ ICSetProp_CallScripted::Compiler::generateStubCode(MacroAssembler& masm)
|
||||
|
||||
// Unbox and shape guard.
|
||||
Register objReg = masm.extractObject(R0, ExtractTemp0);
|
||||
GuardNativeOrUnboxedReceiver(masm, ReceiverGuard::StackGuard(obj_), objReg, scratch,
|
||||
ICSetProp_CallScripted::offsetOfGuard(), &failureUnstow);
|
||||
GuardReceiverObject(masm, ReceiverGuard::StackGuard(obj_), objReg, scratch,
|
||||
ICSetProp_CallScripted::offsetOfGuard(), &failureUnstow);
|
||||
|
||||
Register holderReg = regs.takeAny();
|
||||
masm.loadPtr(Address(BaselineStubReg, ICSetProp_CallScripted::offsetOfHolder()), holderReg);
|
||||
@ -9013,8 +9015,8 @@ ICSetProp_CallNative::Compiler::generateStubCode(MacroAssembler& masm)
|
||||
|
||||
// Unbox and shape guard.
|
||||
Register objReg = masm.extractObject(R0, ExtractTemp0);
|
||||
GuardNativeOrUnboxedReceiver(masm, ReceiverGuard::StackGuard(obj_), objReg, scratch,
|
||||
ICSetProp_CallNative::offsetOfGuard(), &failureUnstow);
|
||||
GuardReceiverObject(masm, ReceiverGuard::StackGuard(obj_), objReg, scratch,
|
||||
ICSetProp_CallNative::offsetOfGuard(), &failureUnstow);
|
||||
|
||||
Register holderReg = regs.takeAny();
|
||||
masm.loadPtr(Address(BaselineStubReg, ICSetProp_CallNative::offsetOfHolder()), holderReg);
|
||||
|
@ -3842,17 +3842,17 @@ class ICGetProp_StringLength : public ICStub
|
||||
};
|
||||
|
||||
// Structure encapsulating the guarding that needs to be done on an object
|
||||
// before it can be accessed or modified.
|
||||
// before it can be accessed or modified by an inline cache.
|
||||
class ReceiverGuard
|
||||
{
|
||||
// Group to guard on, or null. If the object is not unboxed and the IC does
|
||||
// not require the object to have a specific group, this is null.
|
||||
// Otherwise, this is the object's group.
|
||||
// Group to guard on, or null. If the object is not unboxed or typed and
|
||||
// the IC does not require the object to have a specific group, this is
|
||||
// null. Otherwise, this is the object's group.
|
||||
HeapPtrObjectGroup group_;
|
||||
|
||||
// Shape to guard on, or null. If the object is not unboxed then this is
|
||||
// the object's shape. If the object is unboxed, then this is the shape of
|
||||
// the object's expando, null if the object has no expando.
|
||||
// Shape to guard on, or null. If the object is not unboxed or typed then
|
||||
// this is the object's shape. If the object is unboxed, then this is the
|
||||
// shape of the object's expando, null if the object has no expando.
|
||||
HeapPtrShape shape_;
|
||||
|
||||
public:
|
||||
@ -3885,11 +3885,14 @@ class ReceiverGuard
|
||||
: group(nullptr), shape(nullptr)
|
||||
{
|
||||
if (obj) {
|
||||
shape = obj->maybeShape();
|
||||
if (!shape) {
|
||||
if (obj->is<UnboxedPlainObject>()) {
|
||||
group = obj->group();
|
||||
if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando())
|
||||
shape = expando->lastProperty();
|
||||
} else if (obj->is<TypedObject>()) {
|
||||
group = obj->group();
|
||||
} else {
|
||||
shape = obj->maybeShape();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3942,9 +3945,17 @@ class ReceiverGuard
|
||||
// Bits to munge into IC compiler keys when that IC has a ReceiverGuard.
|
||||
// This uses at two bits for data.
|
||||
static int32_t keyBits(JSObject* obj) {
|
||||
if (obj->maybeShape())
|
||||
return 0;
|
||||
return obj->as<UnboxedPlainObject>().maybeExpando() ? 1 : 2;
|
||||
if (obj->is<UnboxedPlainObject>()) {
|
||||
// Both the group and shape need to be guarded for unboxed objects.
|
||||
return obj->as<UnboxedPlainObject>().maybeExpando() ? 0 : 1;
|
||||
}
|
||||
if (obj->is<TypedObject>()) {
|
||||
// Only the group needs to be guarded for typed objects.
|
||||
return 2;
|
||||
}
|
||||
// Other objects only need the shape to be guarded, except for ICs
|
||||
// which always guard the group.
|
||||
return 3;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -7054,22 +7054,31 @@ IonBuilder::maybeInsertResume()
|
||||
return resumeAfter(ins);
|
||||
}
|
||||
|
||||
// Return whether property lookups can be performed effectlessly on clasp.
|
||||
static bool
|
||||
ClassHasEffectlessLookup(const Class* clasp, PropertyName* name)
|
||||
ClassHasEffectlessLookup(const Class* clasp)
|
||||
{
|
||||
return (clasp == &UnboxedPlainObject::class_) ||
|
||||
IsTypedObjectClass(clasp) ||
|
||||
(clasp->isNative() && !clasp->ops.lookupProperty);
|
||||
}
|
||||
|
||||
// Return whether an object might have a property for name which is not
|
||||
// accounted for by type information.
|
||||
static bool
|
||||
ClassHasResolveHook(CompileCompartment* comp, const Class* clasp, PropertyName* name)
|
||||
ObjectHasExtraOwnProperty(CompileCompartment* comp, TypeSet::ObjectKey* object, PropertyName* name)
|
||||
{
|
||||
// While arrays do not have resolve hooks, the types of their |length|
|
||||
// properties are not reflected in type information, so pretend there is a
|
||||
// resolve hook for this property.
|
||||
// Some typed object properties are not reflected in type information.
|
||||
if (object->isGroup() && object->group()->maybeTypeDescr())
|
||||
return object->group()->typeDescr().hasProperty(comp->runtime()->names(), NameToId(name));
|
||||
|
||||
const Class* clasp = object->clasp();
|
||||
|
||||
// Array |length| properties are not reflected in type information.
|
||||
if (clasp == &ArrayObject::class_)
|
||||
return name == comp->runtime()->names().length;
|
||||
|
||||
// Resolve hooks can install new properties on objects on demand.
|
||||
if (!clasp->resolve)
|
||||
return false;
|
||||
|
||||
@ -7126,7 +7135,7 @@ IonBuilder::testSingletonProperty(JSObject* obj, PropertyName* name)
|
||||
// property will change and trigger invalidation.
|
||||
|
||||
while (obj) {
|
||||
if (!ClassHasEffectlessLookup(obj->getClass(), name))
|
||||
if (!ClassHasEffectlessLookup(obj->getClass()))
|
||||
return nullptr;
|
||||
|
||||
TypeSet::ObjectKey* objKey = TypeSet::ObjectKey::get(obj);
|
||||
@ -7143,7 +7152,7 @@ IonBuilder::testSingletonProperty(JSObject* obj, PropertyName* name)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (ClassHasResolveHook(compartment, obj->getClass(), name))
|
||||
if (ObjectHasExtraOwnProperty(compartment, objKey, name))
|
||||
return nullptr;
|
||||
|
||||
obj = obj->getProto();
|
||||
@ -7215,7 +7224,7 @@ IonBuilder::testSingletonPropertyTypes(MDefinition* obj, JSObject* singleton, Pr
|
||||
key->ensureTrackedProperty(analysisContext, NameToId(name));
|
||||
|
||||
const Class* clasp = key->clasp();
|
||||
if (!ClassHasEffectlessLookup(clasp, name) || ClassHasResolveHook(compartment, clasp, name))
|
||||
if (!ClassHasEffectlessLookup(clasp) || ObjectHasExtraOwnProperty(compartment, key, name))
|
||||
return false;
|
||||
if (key->unknownProperties())
|
||||
return false;
|
||||
@ -9636,19 +9645,18 @@ IonBuilder::objectsHaveCommonPrototype(TemporaryTypeSet* types, PropertyName* na
|
||||
return false;
|
||||
|
||||
const Class* clasp = key->clasp();
|
||||
if (!ClassHasEffectlessLookup(clasp, name))
|
||||
if (!ClassHasEffectlessLookup(clasp))
|
||||
return false;
|
||||
JSObject* singleton = key->isSingleton() ? key->singleton() : nullptr;
|
||||
if (ClassHasResolveHook(compartment, clasp, name)) {
|
||||
if (ObjectHasExtraOwnProperty(compartment, key, name)) {
|
||||
if (!singleton || !singleton->is<GlobalObject>())
|
||||
return false;
|
||||
*guardGlobal = true;
|
||||
}
|
||||
|
||||
// Look for a getter/setter on the class itself which may need
|
||||
// to be called. Ignore the getProperty op for typed arrays, it
|
||||
// only handles integers and forwards names to the prototype.
|
||||
if (isGetter && clasp->ops.getProperty && !IsAnyTypedArrayClass(clasp))
|
||||
// to be called.
|
||||
if (isGetter && clasp->ops.getProperty)
|
||||
return false;
|
||||
if (!isGetter && clasp->ops.setProperty)
|
||||
return false;
|
||||
@ -9806,7 +9814,7 @@ IonBuilder::annotateGetPropertyCache(MDefinition* obj, MGetPropertyCache* getPro
|
||||
continue;
|
||||
|
||||
const Class* clasp = key->clasp();
|
||||
if (!ClassHasEffectlessLookup(clasp, name) || ClassHasResolveHook(compartment, clasp, name))
|
||||
if (!ClassHasEffectlessLookup(clasp) || ObjectHasExtraOwnProperty(compartment, key, name))
|
||||
continue;
|
||||
|
||||
HeapTypeSetKey ownTypes = key->property(NameToId(name));
|
||||
|
@ -704,15 +704,7 @@ TestMatchingReceiver(MacroAssembler& masm, IonCache::StubAttacher& attacher,
|
||||
Register object, JSObject* obj, Label* failure,
|
||||
bool alwaysCheckGroup = false)
|
||||
{
|
||||
if (Shape* shape = obj->maybeShape()) {
|
||||
attacher.branchNextStubOrLabel(masm, Assembler::NotEqual,
|
||||
Address(object, JSObject::offsetOfShape()),
|
||||
ImmGCPtr(shape), failure);
|
||||
|
||||
if (alwaysCheckGroup)
|
||||
masm.branchTestObjGroup(Assembler::NotEqual, object, obj->group(), failure);
|
||||
} else {
|
||||
MOZ_ASSERT(obj->is<UnboxedPlainObject>());
|
||||
if (obj->is<UnboxedPlainObject>()) {
|
||||
MOZ_ASSERT(failure);
|
||||
|
||||
masm.branchTestObjGroup(Assembler::NotEqual, object, obj->group(), failure);
|
||||
@ -731,6 +723,20 @@ TestMatchingReceiver(MacroAssembler& masm, IonCache::StubAttacher& attacher,
|
||||
} else {
|
||||
masm.branchPtr(Assembler::NotEqual, expandoAddress, ImmWord(0), failure);
|
||||
}
|
||||
} else if (obj->is<TypedObject>()) {
|
||||
attacher.branchNextStubOrLabel(masm, Assembler::NotEqual,
|
||||
Address(object, JSObject::offsetOfGroup()),
|
||||
ImmGCPtr(obj->group()), failure);
|
||||
} else {
|
||||
Shape* shape = obj->maybeShape();
|
||||
MOZ_ASSERT(shape);
|
||||
|
||||
attacher.branchNextStubOrLabel(masm, Assembler::NotEqual,
|
||||
Address(object, JSObject::offsetOfShape()),
|
||||
ImmGCPtr(shape), failure);
|
||||
|
||||
if (alwaysCheckGroup)
|
||||
masm.branchTestObjGroup(Assembler::NotEqual, object, obj->group(), failure);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2936,16 +2936,20 @@ js::LookupPropertyPure(ExclusiveContext* cx, JSObject* obj, jsid id, JSObject**
|
||||
break;
|
||||
return false;
|
||||
} while (0);
|
||||
} else {
|
||||
// Search for a property on an unboxed object. Other non-native objects
|
||||
// are not handled here.
|
||||
if (!obj->is<UnboxedPlainObject>())
|
||||
return false;
|
||||
} else if (obj->is<UnboxedPlainObject>()) {
|
||||
if (obj->as<UnboxedPlainObject>().containsUnboxedOrExpandoProperty(cx, id)) {
|
||||
*objp = obj;
|
||||
MarkNonNativePropertyFound<NoGC>(propp);
|
||||
return true;
|
||||
}
|
||||
} else if (obj->is<TypedObject>()) {
|
||||
if (obj->as<TypedObject>().typeDescr().hasProperty(cx->names(), id)) {
|
||||
*objp = obj;
|
||||
MarkNonNativePropertyFound<NoGC>(propp);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
obj = obj->getProto();
|
||||
|
@ -266,7 +266,7 @@ interface nsIXPCFunctionThisTranslator : nsISupports
|
||||
{ 0xbd, 0xd6, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
|
||||
%}
|
||||
|
||||
[noscript, uuid(6872bfd6-660b-4aa3-b54b-41ce1d2d69e3)]
|
||||
[noscript, uuid(241fbefa-89dc-42b2-b180-08167d4b351b)]
|
||||
interface nsIXPConnect : nsISupports
|
||||
{
|
||||
%{ C++
|
||||
@ -407,14 +407,6 @@ interface nsIXPConnect : nsISupports
|
||||
getNativeOfWrapper(in JSContextPtr aJSContext,
|
||||
in JSObjectPtr aJSObj);
|
||||
|
||||
nsIStackFrame
|
||||
createStackFrameLocation(in uint32_t aLanguage,
|
||||
in string aFilename,
|
||||
in string aFunctionName,
|
||||
in int32_t aLineNumber,
|
||||
in nsIStackFrame aCaller);
|
||||
|
||||
|
||||
[noscript,notxpcom,nostdcall] JSContextPtr getCurrentJSContext();
|
||||
[noscript,notxpcom,nostdcall] JSContextPtr getSafeJSContext();
|
||||
|
||||
|
@ -144,7 +144,7 @@ this.XPCOMUtils = {
|
||||
countRef.value = _interfaces.length;
|
||||
return _interfaces;
|
||||
},
|
||||
getHelperForLanguage: function XPCU_getHelperForLanguage(language) null,
|
||||
getScriptableHelper: function XPCU_getScriptableHelper() null,
|
||||
contractID: classInfo.contractID,
|
||||
classDescription: classInfo.classDescription,
|
||||
classID: classInfo.classID,
|
||||
|
@ -153,10 +153,9 @@ oom:
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* nsISupports getHelperForLanguage (in uint32_t language); */
|
||||
/* nsIXPCScriptable getScriptableHelper(); */
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Interfaces::GetHelperForLanguage(uint32_t language,
|
||||
nsISupports** retval)
|
||||
nsXPCComponents_Interfaces::GetScriptableHelper(nsIXPCScriptable** retval)
|
||||
{
|
||||
*retval = nullptr;
|
||||
return NS_OK;
|
||||
@ -397,10 +396,9 @@ oom:
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* nsISupports getHelperForLanguage (in uint32_t language); */
|
||||
/* nsIXPCScriptable getScriptableHelper(); */
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_InterfacesByID::GetHelperForLanguage(uint32_t language,
|
||||
nsISupports** retval)
|
||||
nsXPCComponents_InterfacesByID::GetScriptableHelper(nsIXPCScriptable** retval)
|
||||
{
|
||||
*retval = nullptr;
|
||||
return NS_OK;
|
||||
@ -643,10 +641,9 @@ oom:
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* nsISupports getHelperForLanguage (in uint32_t language); */
|
||||
/* nsIXPCScriptable getScriptableHelper(); */
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Classes::GetHelperForLanguage(uint32_t language,
|
||||
nsISupports** retval)
|
||||
nsXPCComponents_Classes::GetScriptableHelper(nsIXPCScriptable** retval)
|
||||
{
|
||||
*retval = nullptr;
|
||||
return NS_OK;
|
||||
@ -869,10 +866,9 @@ oom:
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* nsISupports getHelperForLanguage (in uint32_t language); */
|
||||
/* nsIXPCScriptable getScriptableHelper(); */
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_ClassesByID::GetHelperForLanguage(uint32_t language,
|
||||
nsISupports** retval)
|
||||
nsXPCComponents_ClassesByID::GetScriptableHelper(nsIXPCScriptable** retval)
|
||||
{
|
||||
*retval = nullptr;
|
||||
return NS_OK;
|
||||
@ -1118,10 +1114,9 @@ oom:
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* nsISupports getHelperForLanguage (in uint32_t language); */
|
||||
/* nsIXPCScriptable getScriptableHelper(); */
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Results::GetHelperForLanguage(uint32_t language,
|
||||
nsISupports** retval)
|
||||
nsXPCComponents_Results::GetScriptableHelper(nsIXPCScriptable** retval)
|
||||
{
|
||||
*retval = nullptr;
|
||||
return NS_OK;
|
||||
@ -1324,10 +1319,9 @@ oom:
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* nsISupports getHelperForLanguage (in uint32_t language); */
|
||||
/* nsIXPCScriptable getScriptableHelper(); */
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_ID::GetHelperForLanguage(uint32_t language,
|
||||
nsISupports** retval)
|
||||
nsXPCComponents_ID::GetScriptableHelper(nsIXPCScriptable** retval)
|
||||
{
|
||||
*retval = nullptr;
|
||||
return NS_OK;
|
||||
@ -1541,10 +1535,9 @@ oom:
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* nsISupports getHelperForLanguage (in uint32_t language); */
|
||||
/* nsIXPCScriptable getScriptableHelper(); */
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Exception::GetHelperForLanguage(uint32_t language,
|
||||
nsISupports** retval)
|
||||
nsXPCComponents_Exception::GetScriptableHelper(nsIXPCScriptable** retval)
|
||||
{
|
||||
*retval = nullptr;
|
||||
return NS_OK;
|
||||
@ -1931,10 +1924,9 @@ oom:
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* nsISupports getHelperForLanguage (in uint32_t language); */
|
||||
/* nsIXPCScriptable getScriptableHelper(); */
|
||||
NS_IMETHODIMP
|
||||
nsXPCConstructor::GetHelperForLanguage(uint32_t language,
|
||||
nsISupports** retval)
|
||||
nsXPCConstructor::GetScriptableHelper(nsIXPCScriptable** retval)
|
||||
{
|
||||
*retval = nullptr;
|
||||
return NS_OK;
|
||||
@ -2186,10 +2178,9 @@ oom:
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* nsISupports getHelperForLanguage (in uint32_t language); */
|
||||
/* nsIXPCScriptable getScriptableHelper(); */
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Constructor::GetHelperForLanguage(uint32_t language,
|
||||
nsISupports** retval)
|
||||
nsXPCComponents_Constructor::GetScriptableHelper(nsIXPCScriptable** retval)
|
||||
{
|
||||
*retval = nullptr;
|
||||
return NS_OK;
|
||||
@ -3735,7 +3726,7 @@ public:
|
||||
// The NS_IMETHODIMP isn't really accurate here, but NS_CALLBACK requires
|
||||
// the referent to be declared __stdcall on Windows, and this is the only
|
||||
// macro that does that.
|
||||
static NS_IMETHODIMP Get(uint32_t aLangId, nsISupports** helper)
|
||||
static NS_IMETHODIMP Get(nsIXPCScriptable** helper)
|
||||
{
|
||||
*helper = &singleton;
|
||||
return NS_OK;
|
||||
|
@ -239,15 +239,11 @@ static void EnsureClassObjectsInitialized()
|
||||
}
|
||||
}
|
||||
|
||||
NS_METHOD GetSharedScriptableHelperForJSIID(uint32_t language,
|
||||
nsISupports** helper)
|
||||
NS_METHOD GetSharedScriptableHelperForJSIID(nsIXPCScriptable** helper)
|
||||
{
|
||||
EnsureClassObjectsInitialized();
|
||||
if (language == nsIProgrammingLanguage::JAVASCRIPT) {
|
||||
nsCOMPtr<nsIXPCScriptable> temp = gSharedScriptableHelperForJSIID.get();
|
||||
temp.forget(helper);
|
||||
} else
|
||||
*helper = nullptr;
|
||||
nsCOMPtr<nsIXPCScriptable> temp = gSharedScriptableHelperForJSIID.get();
|
||||
temp.forget(helper);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -114,14 +114,12 @@ oom:
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* nsISupports getHelperForLanguage (in uint32_t language); */
|
||||
/* nsIXPCScriptable getScriptableHelper (); */
|
||||
NS_IMETHODIMP
|
||||
BackstagePass::GetHelperForLanguage(uint32_t language,
|
||||
nsISupports** retval)
|
||||
BackstagePass::GetScriptableHelper(nsIXPCScriptable** retval)
|
||||
{
|
||||
nsCOMPtr<nsISupports> supports =
|
||||
do_QueryInterface(static_cast<nsIGlobalObject*>(this));
|
||||
supports.forget(retval);
|
||||
nsCOMPtr<nsIXPCScriptable> scriptable = this;
|
||||
scriptable.forget(retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -655,16 +655,12 @@ XPCWrappedNative::GatherProtoScriptableCreateInfo(nsIClassInfo* classInfo,
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> possibleHelper;
|
||||
nsresult rv = classInfo->GetHelperForLanguage(nsIProgrammingLanguage::JAVASCRIPT,
|
||||
getter_AddRefs(possibleHelper));
|
||||
if (NS_SUCCEEDED(rv) && possibleHelper) {
|
||||
nsCOMPtr<nsIXPCScriptable> helper(do_QueryInterface(possibleHelper));
|
||||
if (helper) {
|
||||
uint32_t flags = helper->GetScriptableFlags();
|
||||
sciProto.SetCallback(helper.forget());
|
||||
sciProto.SetFlags(XPCNativeScriptableFlags(flags));
|
||||
}
|
||||
nsCOMPtr<nsIXPCScriptable> helper;
|
||||
nsresult rv = classInfo->GetScriptableHelper(getter_AddRefs(helper));
|
||||
if (NS_SUCCEEDED(rv) && helper) {
|
||||
uint32_t flags = helper->GetScriptableFlags();
|
||||
sciProto.SetCallback(helper.forget());
|
||||
sciProto.SetFlags(XPCNativeScriptableFlags(flags));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -690,27 +690,6 @@ nsXPConnect::GetWrappedNativeOfNativeObject(JSContext * aJSContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIStackFrame createStackFrameLocation (in uint32_t aLanguage, in string aFilename, in string aFunctionName, in int32_t aLineNumber, in nsIStackFrame aCaller); */
|
||||
NS_IMETHODIMP
|
||||
nsXPConnect::CreateStackFrameLocation(uint32_t aLanguage,
|
||||
const char* aFilename,
|
||||
const char* aFunctionName,
|
||||
int32_t aLineNumber,
|
||||
nsIStackFrame* aCaller,
|
||||
nsIStackFrame** _retval)
|
||||
{
|
||||
MOZ_ASSERT(_retval, "bad param");
|
||||
|
||||
nsCOMPtr<nsIStackFrame> stackFrame =
|
||||
exceptions::CreateStackFrameLocation(aLanguage,
|
||||
aFilename,
|
||||
aFunctionName,
|
||||
aLineNumber,
|
||||
aCaller);
|
||||
stackFrame.forget(_retval);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIStackFrame CurrentJSStack; */
|
||||
NS_IMETHODIMP
|
||||
nsXPConnect::GetCurrentJSStack(nsIStackFrame * *aCurrentJSStack)
|
||||
|
@ -68,7 +68,7 @@ BlobComponent.prototype =
|
||||
return interfaces;
|
||||
},
|
||||
|
||||
getHelperForLanguage: function getHelperForLanguage(aLanguage) {
|
||||
getScriptableHelper: function getScriptableHelper() {
|
||||
return null;
|
||||
},
|
||||
|
||||
|
@ -93,7 +93,7 @@ FileComponent.prototype =
|
||||
return interfaces;
|
||||
},
|
||||
|
||||
getHelperForLanguage: function getHelperForLanguage(aLanguage) {
|
||||
getScriptableHelper: function getScriptableHelper() {
|
||||
return null;
|
||||
},
|
||||
|
||||
|
@ -35,7 +35,7 @@ FooComponent.prototype =
|
||||
return interfaces;
|
||||
},
|
||||
|
||||
getHelperForLanguage: function getHelperForLanguage(aLanguage) {
|
||||
getScriptableHelper: function getScriptableHelper() {
|
||||
return null;
|
||||
},
|
||||
|
||||
@ -68,7 +68,7 @@ BarComponent.prototype =
|
||||
return interfaces;
|
||||
},
|
||||
|
||||
getHelperForLanguage: function getHelperForLanguage(aLanguage) {
|
||||
getScriptableHelper: function getScriptableHelper() {
|
||||
return null;
|
||||
},
|
||||
|
||||
|
@ -2797,7 +2797,7 @@ PaintInactiveLayer(nsDisplayListBuilder* aBuilder,
|
||||
RefPtr<DrawTarget> tempDT;
|
||||
if (gfxUtils::sDumpPainting) {
|
||||
tempDT = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
|
||||
itemVisibleRect.Size().ToIntSize(),
|
||||
itemVisibleRect.Size(),
|
||||
SurfaceFormat::B8G8R8A8);
|
||||
if (tempDT) {
|
||||
context = new gfxContext(tempDT);
|
||||
|
@ -4737,9 +4737,10 @@ nsImageRenderer::ComputeIntrinsicSize()
|
||||
int32_t appUnitsPerDevPixel =
|
||||
mForFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
result.SetSize(
|
||||
nsSVGIntegrationUtils::GetContinuationUnionSize(mPaintServerFrame).
|
||||
ToNearestPixels(appUnitsPerDevPixel).
|
||||
ToAppUnits(appUnitsPerDevPixel));
|
||||
IntSizeToAppUnits(
|
||||
nsSVGIntegrationUtils::GetContinuationUnionSize(mPaintServerFrame).
|
||||
ToNearestPixels(appUnitsPerDevPixel),
|
||||
appUnitsPerDevPixel));
|
||||
}
|
||||
} else {
|
||||
NS_ASSERTION(mImageElementSurface.mSourceSurface, "Surface should be ready.");
|
||||
|
@ -411,13 +411,11 @@ AddAnimationsForProperty(nsIFrame* aFrame, nsCSSProperty aProperty,
|
||||
{
|
||||
for (size_t playerIdx = 0; playerIdx < aPlayers.Length(); playerIdx++) {
|
||||
AnimationPlayer* player = aPlayers[playerIdx];
|
||||
if (!player->IsRunning()) {
|
||||
if (!player->IsPlaying()) {
|
||||
continue;
|
||||
}
|
||||
dom::Animation* anim = player->GetSource();
|
||||
if (!anim) {
|
||||
continue;
|
||||
}
|
||||
MOZ_ASSERT(anim, "A playing player should have a source animation");
|
||||
const AnimationProperty* property =
|
||||
anim->GetAnimationOfProperty(aProperty);
|
||||
if (!property) {
|
||||
@ -3019,11 +3017,6 @@ nsDisplayThemedBackground::GetBoundsInternal() {
|
||||
presContext->GetTheme()->
|
||||
GetWidgetOverflow(presContext->DeviceContext(), mFrame,
|
||||
mFrame->StyleDisplay()->mAppearance, &r);
|
||||
#ifdef XP_MACOSX
|
||||
// Bug 748219
|
||||
r.Inflate(mFrame->PresContext()->AppUnitsPerDevPixel());
|
||||
#endif
|
||||
|
||||
return r + ToReferenceFrame();
|
||||
}
|
||||
|
||||
|
@ -6787,7 +6787,7 @@ nsLayoutUtils::SurfaceFromElement(HTMLVideoElement* aElement,
|
||||
}
|
||||
|
||||
result.mCORSUsed = aElement->GetCORSMode() != CORS_NONE;
|
||||
result.mSize = ThebesIntSize(size);
|
||||
result.mSize = size;
|
||||
result.mPrincipal = principal.forget();
|
||||
result.mIsWriteOnly = false;
|
||||
|
||||
|
@ -1434,11 +1434,11 @@ nsPluginFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
NS_ASSERTION(layer->GetType() == Layer::TYPE_READBACK, "Bad layer type");
|
||||
|
||||
ReadbackLayer* readback = static_cast<ReadbackLayer*>(layer.get());
|
||||
if (readback->GetSize() != ThebesIntSize(size)) {
|
||||
if (readback->GetSize() != size) {
|
||||
// This will destroy any old background sink and notify us that the
|
||||
// background is now unknown
|
||||
readback->SetSink(nullptr);
|
||||
readback->SetSize(ThebesIntSize(size));
|
||||
readback->SetSize(size);
|
||||
|
||||
if (mBackgroundSink) {
|
||||
// Maybe we still have a background sink associated with another
|
||||
|
55
layout/reftests/invalidation/masklayer-1.html
Normal file
55
layout/reftests/invalidation/masklayer-1.html
Normal file
@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<meta charset="utf-8">
|
||||
<title>Moving a layer in a box with a rounded clip shouldn't invalidate.</title>
|
||||
|
||||
<style>
|
||||
|
||||
#outer {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
left: 50px;
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
background-color: #DDD;
|
||||
overflow: hidden;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#animatedLeft {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
left: 40px;
|
||||
box-model: border-box;
|
||||
border: 1px solid lime;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="outer">
|
||||
<div id="animatedLeft" class="reftest-no-paint"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
var animatedLeft = document.getElementById("animatedLeft");
|
||||
|
||||
function doTest() {
|
||||
animatedLeft.style.left = "100px";
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
|
||||
// Layerize #animatedLeft
|
||||
animatedLeft.offsetLeft;
|
||||
animatedLeft.style.left = "60px";
|
||||
animatedLeft.offsetLeft;
|
||||
animatedLeft.style.left = "40px";
|
||||
animatedLeft.offsetLeft;
|
||||
|
||||
document.addEventListener("MozReftestInvalidate", doTest, false);
|
||||
|
||||
</script>
|
59
layout/reftests/invalidation/masklayer-2.html
Normal file
59
layout/reftests/invalidation/masklayer-2.html
Normal file
@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<meta charset="utf-8">
|
||||
<title>Moving a layer in a box with a rounded clip shouldn't invalidate.</title>
|
||||
|
||||
<style>
|
||||
|
||||
#scrollbox {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
left: 50px;
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
background-color: #DDD;
|
||||
overflow: auto;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#scrollable {
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
#scrolledLayer {
|
||||
margin-top: 50px;
|
||||
margin-left: 100px;
|
||||
box-model: border-box;
|
||||
border: 1px solid lime;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="scrollbox">
|
||||
<div id="scrollable">
|
||||
<div id="scrolledLayer" class="reftest-no-paint"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
var scrollbox = document.getElementById("scrollbox");
|
||||
|
||||
function doTest() {
|
||||
scrollbox.scrollLeft = 0;
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
|
||||
// Make #scrollbox have active scrolling
|
||||
scrollbox.scrollLeft = 60;
|
||||
scrollbox.offsetLeft;
|
||||
scrollbox.scrollLeft = 40;
|
||||
scrollbox.offsetLeft;
|
||||
|
||||
document.addEventListener("MozReftestInvalidate", doTest, false);
|
||||
|
||||
</script>
|
@ -55,3 +55,5 @@ pref(layout.animated-image-layers.enabled,true) == test-animated-image-layers-ba
|
||||
!= paintedlayer-recycling-5.html about:blank
|
||||
!= paintedlayer-recycling-6.html about:blank
|
||||
!= paintedlayer-recycling-7.html about:blank
|
||||
!= masklayer-1.html about:blank
|
||||
!= masklayer-2.html about:blank
|
||||
|
@ -557,10 +557,13 @@ AnimationPlayerCollection::CanPerformOnCompositorThread(
|
||||
|
||||
for (size_t playerIdx = mPlayers.Length(); playerIdx-- != 0; ) {
|
||||
const AnimationPlayer* player = mPlayers[playerIdx];
|
||||
if (!player->IsRunning() || !player->GetSource()) {
|
||||
if (!player->IsPlaying()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const Animation* anim = player->GetSource();
|
||||
MOZ_ASSERT(anim, "A playing player should have a source animation");
|
||||
|
||||
for (size_t propIdx = 0, propEnd = anim->Properties().Length();
|
||||
propIdx != propEnd; ++propIdx) {
|
||||
if (IsGeometricProperty(anim->Properties()[propIdx].mProperty)) {
|
||||
@ -573,11 +576,13 @@ AnimationPlayerCollection::CanPerformOnCompositorThread(
|
||||
bool existsProperty = false;
|
||||
for (size_t playerIdx = mPlayers.Length(); playerIdx-- != 0; ) {
|
||||
const AnimationPlayer* player = mPlayers[playerIdx];
|
||||
if (!player->IsRunning() || !player->GetSource()) {
|
||||
if (!player->IsPlaying()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const Animation* anim = player->GetSource();
|
||||
MOZ_ASSERT(anim, "A playing player should have a source animation");
|
||||
|
||||
existsProperty = existsProperty || anim->Properties().Length() > 0;
|
||||
|
||||
for (size_t propIdx = 0, propEnd = anim->Properties().Length();
|
||||
@ -854,8 +859,11 @@ AnimationPlayerCollection::HasCurrentAnimationsForProperty(nsCSSProperty
|
||||
aProperty) const
|
||||
{
|
||||
for (size_t playerIdx = mPlayers.Length(); playerIdx-- != 0; ) {
|
||||
const Animation* anim = mPlayers[playerIdx]->GetSource();
|
||||
if (anim && anim->IsCurrent() && anim->HasAnimationOfProperty(aProperty)) {
|
||||
const AnimationPlayer& player = *mPlayers[playerIdx];
|
||||
const Animation* anim = player.GetSource();
|
||||
if (anim &&
|
||||
anim->IsCurrent(player) &&
|
||||
anim->HasAnimationOfProperty(aProperty)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -2495,14 +2495,13 @@ BuildStyleRule(nsCSSProperty aProperty,
|
||||
nsCSSProps::SubpropertyEntryFor(aProperty)[0] : aProperty;
|
||||
|
||||
// Get a parser, parse the property, and check for CSS parsing errors.
|
||||
// If any of these steps fails, we bail out and delete the declaration.
|
||||
if (NS_FAILED(parser.ParseProperty(aProperty, aSpecifiedValue,
|
||||
doc->GetDocumentURI(), baseURI,
|
||||
aTargetElement->NodePrincipal(),
|
||||
declaration, &changed, false,
|
||||
aUseSVGMode)) ||
|
||||
// check whether property parsed without CSS parsing errors
|
||||
!declaration->HasNonImportantValueFor(propertyToCheck)) {
|
||||
// If this fails, we bail out and delete the declaration.
|
||||
parser.ParseProperty(aProperty, aSpecifiedValue, doc->GetDocumentURI(),
|
||||
baseURI, aTargetElement->NodePrincipal(), declaration,
|
||||
&changed, false, aUseSVGMode);
|
||||
|
||||
// check whether property parsed without CSS parsing errors
|
||||
if (!declaration->HasNonImportantValueFor(propertyToCheck)) {
|
||||
NS_WARNING("failure in BuildStyleRule");
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -144,15 +144,15 @@ public:
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
css::Rule** aResult);
|
||||
|
||||
nsresult ParseProperty(const nsCSSProperty aPropID,
|
||||
const nsAString& aPropValue,
|
||||
nsIURI* aSheetURL,
|
||||
nsIURI* aBaseURL,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
css::Declaration* aDeclaration,
|
||||
bool* aChanged,
|
||||
bool aIsImportant,
|
||||
bool aIsSVGMode);
|
||||
void ParseProperty(const nsCSSProperty aPropID,
|
||||
const nsAString& aPropValue,
|
||||
nsIURI* aSheetURL,
|
||||
nsIURI* aBaseURL,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
css::Declaration* aDeclaration,
|
||||
bool* aChanged,
|
||||
bool aIsImportant,
|
||||
bool aIsSVGMode);
|
||||
|
||||
void ParseMediaList(const nsSubstring& aBuffer,
|
||||
nsIURI* aURL, // for error reporting
|
||||
@ -167,14 +167,14 @@ public:
|
||||
InfallibleTArray<nsCSSValue>& aValues,
|
||||
bool aHTMLMode);
|
||||
|
||||
nsresult ParseVariable(const nsAString& aVariableName,
|
||||
const nsAString& aPropValue,
|
||||
nsIURI* aSheetURL,
|
||||
nsIURI* aBaseURL,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
css::Declaration* aDeclaration,
|
||||
bool* aChanged,
|
||||
bool aIsImportant);
|
||||
void ParseVariable(const nsAString& aVariableName,
|
||||
const nsAString& aPropValue,
|
||||
nsIURI* aSheetURL,
|
||||
nsIURI* aBaseURL,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
css::Declaration* aDeclaration,
|
||||
bool* aChanged,
|
||||
bool aIsImportant);
|
||||
|
||||
bool ParseFontFamilyListString(const nsSubstring& aBuffer,
|
||||
nsIURI* aURL, // for error reporting
|
||||
@ -1615,7 +1615,7 @@ CSSParserImpl::ParseRule(const nsAString& aRule,
|
||||
#pragma warning( disable : 4748 )
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
void
|
||||
CSSParserImpl::ParseProperty(const nsCSSProperty aPropID,
|
||||
const nsAString& aPropValue,
|
||||
nsIURI* aSheetURI,
|
||||
@ -1654,7 +1654,7 @@ CSSParserImpl::ParseProperty(const nsCSSProperty aPropID,
|
||||
REPORT_UNEXPECTED(PEDeclDropped);
|
||||
OUTPUT_ERROR();
|
||||
ReleaseScanner();
|
||||
return NS_OK;
|
||||
return;
|
||||
}
|
||||
|
||||
bool parsedOK = ParseProperty(aPropID);
|
||||
@ -1693,10 +1693,9 @@ CSSParserImpl::ParseProperty(const nsCSSProperty aPropID,
|
||||
mTempData.AssertInitialState();
|
||||
|
||||
ReleaseScanner();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
void
|
||||
CSSParserImpl::ParseVariable(const nsAString& aVariableName,
|
||||
const nsAString& aPropValue,
|
||||
nsIURI* aSheetURI,
|
||||
@ -1749,7 +1748,6 @@ CSSParserImpl::ParseVariable(const nsAString& aVariableName,
|
||||
mTempData.AssertInitialState();
|
||||
|
||||
ReleaseScanner();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
@ -15568,7 +15566,7 @@ nsCSSParser::ParseRule(const nsAString& aRule,
|
||||
ParseRule(aRule, aSheetURI, aBaseURI, aSheetPrincipal, aResult);
|
||||
}
|
||||
|
||||
nsresult
|
||||
void
|
||||
nsCSSParser::ParseProperty(const nsCSSProperty aPropID,
|
||||
const nsAString& aPropValue,
|
||||
nsIURI* aSheetURI,
|
||||
@ -15579,13 +15577,13 @@ nsCSSParser::ParseProperty(const nsCSSProperty aPropID,
|
||||
bool aIsImportant,
|
||||
bool aIsSVGMode)
|
||||
{
|
||||
return static_cast<CSSParserImpl*>(mImpl)->
|
||||
static_cast<CSSParserImpl*>(mImpl)->
|
||||
ParseProperty(aPropID, aPropValue, aSheetURI, aBaseURI,
|
||||
aSheetPrincipal, aDeclaration, aChanged,
|
||||
aIsImportant, aIsSVGMode);
|
||||
}
|
||||
|
||||
nsresult
|
||||
void
|
||||
nsCSSParser::ParseVariable(const nsAString& aVariableName,
|
||||
const nsAString& aPropValue,
|
||||
nsIURI* aSheetURI,
|
||||
@ -15595,7 +15593,7 @@ nsCSSParser::ParseVariable(const nsAString& aVariableName,
|
||||
bool* aChanged,
|
||||
bool aIsImportant)
|
||||
{
|
||||
return static_cast<CSSParserImpl*>(mImpl)->
|
||||
static_cast<CSSParserImpl*>(mImpl)->
|
||||
ParseVariable(aVariableName, aPropValue, aSheetURI, aBaseURI,
|
||||
aSheetPrincipal, aDeclaration, aChanged, aIsImportant);
|
||||
}
|
||||
|
@ -122,25 +122,25 @@ public:
|
||||
// particular, units may be omitted from <length>. The 'aIsSVGMode'
|
||||
// argument controls this quirk. Note that this *only* applies to
|
||||
// mapped attributes, not inline styles or full style sheets in SVG.
|
||||
nsresult ParseProperty(const nsCSSProperty aPropID,
|
||||
const nsAString& aPropValue,
|
||||
nsIURI* aSheetURL,
|
||||
nsIURI* aBaseURL,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
mozilla::css::Declaration* aDeclaration,
|
||||
bool* aChanged,
|
||||
bool aIsImportant,
|
||||
bool aIsSVGMode = false);
|
||||
void ParseProperty(const nsCSSProperty aPropID,
|
||||
const nsAString& aPropValue,
|
||||
nsIURI* aSheetURL,
|
||||
nsIURI* aBaseURL,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
mozilla::css::Declaration* aDeclaration,
|
||||
bool* aChanged,
|
||||
bool aIsImportant,
|
||||
bool aIsSVGMode = false);
|
||||
|
||||
// The same as ParseProperty but for a variable.
|
||||
nsresult ParseVariable(const nsAString& aVariableName,
|
||||
const nsAString& aPropValue,
|
||||
nsIURI* aSheetURL,
|
||||
nsIURI* aBaseURL,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
mozilla::css::Declaration* aDeclaration,
|
||||
bool* aChanged,
|
||||
bool aIsImportant);
|
||||
void ParseVariable(const nsAString& aVariableName,
|
||||
const nsAString& aPropValue,
|
||||
nsIURI* aSheetURL,
|
||||
nsIURI* aBaseURL,
|
||||
nsIPrincipal* aSheetPrincipal,
|
||||
mozilla::css::Declaration* aDeclaration,
|
||||
bool* aChanged,
|
||||
bool aIsImportant);
|
||||
/**
|
||||
* Parse aBuffer into a media list |aMediaList|, which must be
|
||||
* non-null, replacing its current contents. If aHTMLMode is true,
|
||||
|
@ -331,14 +331,14 @@ nsDOMCSSDeclaration::ParsePropertyValue(const nsCSSProperty aPropID,
|
||||
|
||||
nsCSSParser cssParser(env.mCSSLoader);
|
||||
bool changed;
|
||||
nsresult result = cssParser.ParseProperty(aPropID, aPropValue, env.mSheetURI,
|
||||
env.mBaseURI, env.mPrincipal, decl,
|
||||
&changed, aIsImportant);
|
||||
if (NS_FAILED(result) || !changed) {
|
||||
cssParser.ParseProperty(aPropID, aPropValue, env.mSheetURI, env.mBaseURI,
|
||||
env.mPrincipal, decl, &changed, aIsImportant);
|
||||
if (!changed) {
|
||||
if (decl != olddecl) {
|
||||
delete decl;
|
||||
}
|
||||
return result;
|
||||
// Parsing failed -- but we don't throw an exception for that.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return SetCSSDeclaration(decl);
|
||||
@ -372,17 +372,17 @@ nsDOMCSSDeclaration::ParseCustomPropertyValue(const nsAString& aPropertyName,
|
||||
|
||||
nsCSSParser cssParser(env.mCSSLoader);
|
||||
bool changed;
|
||||
nsresult result =
|
||||
cssParser.ParseVariable(Substring(aPropertyName,
|
||||
CSS_CUSTOM_NAME_PREFIX_LENGTH),
|
||||
aPropValue, env.mSheetURI,
|
||||
env.mBaseURI, env.mPrincipal, decl,
|
||||
&changed, aIsImportant);
|
||||
if (NS_FAILED(result) || !changed) {
|
||||
cssParser.ParseVariable(Substring(aPropertyName,
|
||||
CSS_CUSTOM_NAME_PREFIX_LENGTH),
|
||||
aPropValue, env.mSheetURI,
|
||||
env.mBaseURI, env.mPrincipal, decl,
|
||||
&changed, aIsImportant);
|
||||
if (!changed) {
|
||||
if (decl != olddecl) {
|
||||
delete decl;
|
||||
}
|
||||
return result;
|
||||
// Parsing failed -- but we don't throw an exception for that.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return SetCSSDeclaration(decl);
|
||||
|
@ -346,7 +346,7 @@ nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget,
|
||||
bool resultOverflows;
|
||||
IntSize surfaceSize =
|
||||
nsSVGUtils::ConvertToSurfaceSize(
|
||||
transformedBBox.Size(), &resultOverflows).ToIntSize();
|
||||
transformedBBox.Size(), &resultOverflows);
|
||||
|
||||
// 0 disables rendering, < 0 is an error
|
||||
if (surfaceSize.width <= 0 || surfaceSize.height <= 0) {
|
||||
|
@ -242,12 +242,13 @@ function setupDisplayport(contentRootElement) {
|
||||
}
|
||||
}
|
||||
|
||||
// Returns whether any offsets were updated
|
||||
function setupAsyncScrollOffsets(options) {
|
||||
var currentDoc = content.document;
|
||||
var contentRootElement = currentDoc ? currentDoc.documentElement : null;
|
||||
|
||||
if (!contentRootElement) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
function setupAsyncScrollOffsetsForElement(element, winUtils) {
|
||||
@ -258,30 +259,38 @@ function setupAsyncScrollOffsets(options) {
|
||||
// This might fail when called from RecordResult since layers
|
||||
// may not have been constructed yet
|
||||
winUtils.setAsyncScrollOffset(element, sx, sy);
|
||||
return true;
|
||||
} catch (e) {
|
||||
if (!options.allowFailure) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function setupAsyncScrollOffsetsForElementSubtree(element, winUtils) {
|
||||
setupAsyncScrollOffsetsForElement(element, winUtils);
|
||||
var updatedAny = setupAsyncScrollOffsetsForElement(element, winUtils);
|
||||
for (var c = element.firstElementChild; c; c = c.nextElementSibling) {
|
||||
setupAsyncScrollOffsetsForElementSubtree(c, winUtils);
|
||||
if (setupAsyncScrollOffsetsForElementSubtree(c, winUtils)) {
|
||||
updatedAny = true;
|
||||
}
|
||||
}
|
||||
if (element.contentDocument) {
|
||||
LogInfo("Descending into subdocument (async offsets)");
|
||||
setupAsyncScrollOffsetsForElementSubtree(element.contentDocument.documentElement,
|
||||
windowUtilsForWindow(element.contentWindow));
|
||||
if (setupAsyncScrollOffsetsForElementSubtree(element.contentDocument.documentElement,
|
||||
windowUtilsForWindow(element.contentWindow))) {
|
||||
updatedAny = true;
|
||||
}
|
||||
}
|
||||
return updatedAny;
|
||||
}
|
||||
|
||||
var asyncScroll = contentRootElement.hasAttribute("reftest-async-scroll");
|
||||
if (asyncScroll) {
|
||||
setupAsyncScrollOffsetsForElementSubtree(contentRootElement, windowUtils());
|
||||
return setupAsyncScrollOffsetsForElementSubtree(contentRootElement, windowUtils());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function resetDisplayportAndViewport() {
|
||||
@ -794,8 +803,13 @@ function RecordResult()
|
||||
}
|
||||
|
||||
// Setup async scroll offsets now in case SynchronizeForSnapshot is not
|
||||
// called (due to reftest-no-sync-layers being supplied).
|
||||
setupAsyncScrollOffsets({allowFailure:true});
|
||||
// called (due to reftest-no-sync-layers being supplied, or in the single
|
||||
// process case).
|
||||
var changedAsyncScrollOffsets = setupAsyncScrollOffsets({allowFailure:true}) ;
|
||||
if (changedAsyncScrollOffsets && !gBrowserIsRemote) {
|
||||
sendAsyncMessage("reftest:UpdateWholeCanvasForInvalidation");
|
||||
}
|
||||
|
||||
SendTestDone(currentTestRunTime);
|
||||
FinishTestItem();
|
||||
}
|
||||
|
@ -2810,13 +2810,6 @@ PeerConnectionImpl::BuildStatsQuery_m(
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
// Note: mMedia->ice_ctx() is deleted on STS thread; so make sure we grab and hold
|
||||
// a ref instead of making multiple calls. NrIceCtx uses threadsafe refcounting.
|
||||
query->iceCtx = mMedia->ice_ctx();
|
||||
if (!query->iceCtx) {
|
||||
CSFLogError(logTag, "Could not build stats query, no ice_ctx");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
if (!mThread) {
|
||||
CSFLogError(logTag, "Could not build stats query, no MainThread");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
@ -2828,6 +2821,16 @@ PeerConnectionImpl::BuildStatsQuery_m(
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Note: mMedia->ice_ctx() is deleted on STS thread; so make sure we grab and hold
|
||||
// a ref instead of making multiple calls. NrIceCtx uses threadsafe refcounting.
|
||||
// NOTE: Do this after all other failure tests, to ensure we don't
|
||||
// accidentally release the Ctx on Mainthread.
|
||||
query->iceCtx = mMedia->ice_ctx();
|
||||
if (!query->iceCtx) {
|
||||
CSFLogError(logTag, "Could not build stats query, no ice_ctx");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
// We do not use the pcHandle here, since that's risky to expose to content.
|
||||
query->report = new RTCStatsReportInternalConstruct(
|
||||
NS_ConvertASCIItoUTF16(mName.c_str()),
|
||||
|
@ -167,23 +167,31 @@ WebrtcGlobalInformation::GetAllStats(
|
||||
pcIdFilter.Value().EqualsASCII(p->second->GetIdAsAscii().c_str())) {
|
||||
if (p->second->HasMedia()) {
|
||||
queries->append(nsAutoPtr<RTCStatsQuery>(new RTCStatsQuery(true)));
|
||||
p->second->BuildStatsQuery_m(nullptr, // all tracks
|
||||
queries->back());
|
||||
if (NS_WARN_IF(NS_FAILED(p->second->BuildStatsQuery_m(nullptr, // all tracks
|
||||
queries->back())))) {
|
||||
queries->popBack();
|
||||
} else {
|
||||
MOZ_ASSERT(queries->back()->report);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CallbackObject does not support threadsafe refcounting, and must be
|
||||
// destroyed on main.
|
||||
nsMainThreadPtrHandle<WebrtcGlobalStatisticsCallback> callbackHandle(
|
||||
new nsMainThreadPtrHolder<WebrtcGlobalStatisticsCallback>(&aStatsCallback));
|
||||
if (!queries->empty()) {
|
||||
// CallbackObject does not support threadsafe refcounting, and must be
|
||||
// destroyed on main.
|
||||
nsMainThreadPtrHandle<WebrtcGlobalStatisticsCallback> callbackHandle(
|
||||
new nsMainThreadPtrHolder<WebrtcGlobalStatisticsCallback>(&aStatsCallback));
|
||||
|
||||
rv = RUN_ON_THREAD(stsThread,
|
||||
WrapRunnableNM(&GetAllStats_s, callbackHandle, queries),
|
||||
NS_DISPATCH_NORMAL);
|
||||
rv = RUN_ON_THREAD(stsThread,
|
||||
WrapRunnableNM(&GetAllStats_s, callbackHandle, queries),
|
||||
NS_DISPATCH_NORMAL);
|
||||
|
||||
aRv = rv;
|
||||
aRv = rv;
|
||||
} else {
|
||||
aRv = NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -347,8 +347,8 @@ SessionStore.prototype = {
|
||||
if (aWindow.BrowserApp.tabs.length > 0) {
|
||||
// Bundle this browser's data and extra data and save in the closedTabs
|
||||
// window property
|
||||
let data = aBrowser.__SS_data;
|
||||
data.extData = aBrowser.__SS_extdata;
|
||||
let data = aBrowser.__SS_data || {};
|
||||
data.extData = aBrowser.__SS_extdata || {};
|
||||
|
||||
this._windows[aWindow.__SSID].closedTabs.unshift(data);
|
||||
let length = this._windows[aWindow.__SSID].closedTabs.length;
|
||||
|
@ -166,7 +166,7 @@ nsJARURI::GetInterfaces(uint32_t *count, nsIID * **array)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsJARURI::GetHelperForLanguage(uint32_t language, nsISupports **_retval)
|
||||
nsJARURI::GetScriptableHelper(nsIXPCScriptable **_retval)
|
||||
{
|
||||
*_retval = nullptr;
|
||||
return NS_OK;
|
||||
|
@ -557,7 +557,7 @@ nsSimpleURI::GetInterfaces(uint32_t *count, nsIID * **array)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSimpleURI::GetHelperForLanguage(uint32_t language, nsISupports **_retval)
|
||||
nsSimpleURI::GetScriptableHelper(nsIXPCScriptable **_retval)
|
||||
{
|
||||
*_retval = nullptr;
|
||||
return NS_OK;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user