Merge mozilla-central to fx-team

This commit is contained in:
Carsten "Tomcat" Book 2014-03-04 15:44:20 +01:00
commit 631128c6db
107 changed files with 1793 additions and 453 deletions

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6df4533f14ec2645bb13d8a803a5151583ca13a8"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="71f78f7f68fcf5e23cc5965fee0dad45289c438b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6df4533f14ec2645bb13d8a803a5151583ca13a8"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="71f78f7f68fcf5e23cc5965fee0dad45289c438b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="b2f773d8320d30648b89767dfe5b25ef94bc7e62"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6df4533f14ec2645bb13d8a803a5151583ca13a8"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="71f78f7f68fcf5e23cc5965fee0dad45289c438b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>

View File

@ -4,6 +4,6 @@
"branch": "",
"revision": ""
},
"revision": "ac8b988b122a95d657c730dcdfabbebf03385b43",
"revision": "020bf0df084e3e80e51f9dfd5fdeef2e8ab90452",
"repo_path": "/integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6df4533f14ec2645bb13d8a803a5151583ca13a8"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="71f78f7f68fcf5e23cc5965fee0dad45289c438b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6df4533f14ec2645bb13d8a803a5151583ca13a8"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="71f78f7f68fcf5e23cc5965fee0dad45289c438b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6df4533f14ec2645bb13d8a803a5151583ca13a8"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="71f78f7f68fcf5e23cc5965fee0dad45289c438b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6df4533f14ec2645bb13d8a803a5151583ca13a8"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="71f78f7f68fcf5e23cc5965fee0dad45289c438b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6df4533f14ec2645bb13d8a803a5151583ca13a8"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="71f78f7f68fcf5e23cc5965fee0dad45289c438b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="b2f773d8320d30648b89767dfe5b25ef94bc7e62"/>

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6df4533f14ec2645bb13d8a803a5151583ca13a8"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="71f78f7f68fcf5e23cc5965fee0dad45289c438b"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>

View File

@ -345,8 +345,10 @@ ifdef LIBXUL_LIBRARY
ifdef IS_COMPONENT
$(error IS_COMPONENT is set, but is not compatible with LIBXUL_LIBRARY)
endif
ifneq (xul,$(LIBRARY_NAME))
FORCE_STATIC_LIB=1
endif
endif
# If we are building this component into an extension/xulapp, it cannot be
# statically linked. In the future we may want to add a xulapp meta-component

View File

@ -1204,8 +1204,6 @@ protected:
template <typename WebGLObjectType>
JSObject* WebGLObjectAsJSObject(JSContext *cx, const WebGLObjectType *, ErrorResult& rv) const;
void ReattachTextureToAnyFramebufferToWorkAroundBugs(WebGLTexture *tex, GLint level);
#ifdef XP_MACOSX
// see bug 713305. This RAII helper guarantees that we're on the discrete GPU, during its lifetime
// Debouncing note: we don't want to switch GPUs too frequently, so try to not create and destroy

View File

@ -477,9 +477,6 @@ WebGLContext::CopyTexSubImage2D_base(GLenum target,
gl->fCopyTexSubImage2D(target, level, actual_xoffset, actual_yoffset, actual_x, actual_y, actual_width, actual_height);
}
if (!sub)
ReattachTextureToAnyFramebufferToWorkAroundBugs(tex, level);
}
void
@ -3375,8 +3372,6 @@ WebGLContext::CompressedTexImage2D(GLenum target, GLint level, GLenum internalfo
MOZ_ASSERT(tex);
tex->SetImageInfo(target, level, width, height, internalformat, LOCAL_GL_UNSIGNED_BYTE,
WebGLImageDataStatus::InitializedImageData);
ReattachTextureToAnyFramebufferToWorkAroundBugs(tex, level);
}
void
@ -3784,8 +3779,6 @@ WebGLContext::TexImage2D_base(GLenum target, GLint level, GLenum internalformat,
MOZ_ASSERT(imageInfoStatusIfSuccess != WebGLImageDataStatus::NoImageData);
tex->SetImageInfo(target, level, width, height, internalformat, type, imageInfoStatusIfSuccess);
ReattachTextureToAnyFramebufferToWorkAroundBugs(tex, level);
}
void
@ -4220,58 +4213,6 @@ InternalFormatForFormatAndType(GLenum format, GLenum type, bool isGLES2)
return 0;
}
void
WebGLContext::ReattachTextureToAnyFramebufferToWorkAroundBugs(WebGLTexture *tex,
GLint level)
{
MOZ_ASSERT(tex);
if (!gl->WorkAroundDriverBugs())
return;
if (!mIsMesa)
return;
MakeContextCurrent();
WebGLFramebuffer* curFB = mBoundFramebuffer;
for(WebGLFramebuffer *framebuffer = mFramebuffers.getFirst();
framebuffer;
framebuffer = framebuffer->getNext())
{
size_t colorAttachmentCount = framebuffer->mColorAttachments.Length();
for (size_t i = 0; i < colorAttachmentCount; i++)
{
if (framebuffer->ColorAttachment(i).Texture() == tex) {
BindFramebuffer(LOCAL_GL_FRAMEBUFFER, framebuffer);
framebuffer->FramebufferTexture2D(
LOCAL_GL_FRAMEBUFFER, LOCAL_GL_COLOR_ATTACHMENT0 + i,
tex->Target(), tex, level);
}
}
if (framebuffer->DepthAttachment().Texture() == tex) {
BindFramebuffer(LOCAL_GL_FRAMEBUFFER, framebuffer);
framebuffer->FramebufferTexture2D(
LOCAL_GL_FRAMEBUFFER, LOCAL_GL_DEPTH_ATTACHMENT,
tex->Target(), tex, level);
}
if (framebuffer->StencilAttachment().Texture() == tex) {
BindFramebuffer(LOCAL_GL_FRAMEBUFFER, framebuffer);
framebuffer->FramebufferTexture2D(
LOCAL_GL_FRAMEBUFFER, LOCAL_GL_STENCIL_ATTACHMENT,
tex->Target(), tex, level);
}
if (framebuffer->DepthStencilAttachment().Texture() == tex) {
BindFramebuffer(LOCAL_GL_FRAMEBUFFER, framebuffer);
framebuffer->FramebufferTexture2D(
LOCAL_GL_FRAMEBUFFER, LOCAL_GL_DEPTH_STENCIL_ATTACHMENT,
tex->Target(), tex, level);
}
}
BindFramebuffer(LOCAL_GL_FRAMEBUFFER, curFB);
}
void
WebGLContext::BlendColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a) {
if (IsContextLost())

View File

@ -254,7 +254,6 @@ HTMLVideoElement::GetVideoPlaybackQuality()
uint64_t totalFrames = 0;
uint64_t droppedFrames = 0;
uint64_t corruptedFrames = 0;
double totalFrameDelay = 0.0;
if (sVideoStatsEnabled) {
nsPIDOMWindow* window = OwnerDoc()->GetInnerWindow();
@ -270,13 +269,12 @@ HTMLVideoElement::GetVideoPlaybackQuality()
totalFrames = stats.GetParsedFrames();
droppedFrames = totalFrames - stats.GetPresentedFrames();
corruptedFrames = totalFrames - stats.GetDecodedFrames();
totalFrameDelay = stats.GetTotalFrameDelay();
}
}
nsRefPtr<VideoPlaybackQuality> playbackQuality =
new VideoPlaybackQuality(this, creationTime, totalFrames, droppedFrames,
corruptedFrames, totalFrameDelay);
corruptedFrames);
return playbackQuality.forget();
}

View File

@ -893,7 +893,6 @@ public:
FrameStatistics() :
mReentrantMonitor("MediaDecoder::FrameStats"),
mTotalFrameDelay(0.0),
mParsedFrames(0),
mDecodedFrames(0),
mPresentedFrames(0) {}
@ -920,11 +919,6 @@ public:
return mPresentedFrames;
}
double GetTotalFrameDelay() {
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
return mTotalFrameDelay;
}
// Increments the parsed and decoded frame counters by the passed in counts.
// Can be called on any thread.
void NotifyDecodedFrames(uint32_t aParsed, uint32_t aDecoded) {
@ -942,22 +936,11 @@ public:
++mPresentedFrames;
}
// Tracks the sum of display delay.
// Can be called on any thread.
void NotifyFrameDelay(double aFrameDelay) {
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
mTotalFrameDelay += aFrameDelay;
}
private:
// ReentrantMonitor to protect access of playback statistics.
ReentrantMonitor mReentrantMonitor;
// Sum of displayed frame delays.
// Access protected by mReentrantMonitor.
double mTotalFrameDelay;
// Number of frames parsed and demuxed from media.
// Access protected by mReentrantMonitor.
uint32_t mParsedFrames;

View File

@ -2336,9 +2336,6 @@ void MediaDecoderStateMachine::AdvanceFrame()
}
MediaDecoder::FrameStatistics& frameStats = mDecoder->GetFrameStatistics();
frameStats.NotifyPresentedFrame();
double frameDelay = double(clock_time - currentFrame->mTime) / USECS_PER_S;
NS_ASSERTION(frameDelay >= 0.0, "Frame should never be displayed early.");
frameStats.NotifyFrameDelay(frameDelay);
remainingTime = currentFrame->GetEndTime() - clock_time;
currentFrame = nullptr;
}

View File

@ -18,14 +18,12 @@ VideoPlaybackQuality::VideoPlaybackQuality(HTMLMediaElement* aElement,
DOMHighResTimeStamp aCreationTime,
uint64_t aTotalFrames,
uint64_t aDroppedFrames,
uint64_t aCorruptedFrames,
double aTotalFrameDelay)
uint64_t aCorruptedFrames)
: mElement(aElement)
, mCreationTime(aCreationTime)
, mTotalFrames(aTotalFrames)
, mDroppedFrames(aDroppedFrames)
, mCorruptedFrames(aCorruptedFrames)
, mTotalFrameDelay(aTotalFrameDelay)
{
SetIsDOMBinding();
}

View File

@ -23,7 +23,7 @@ public:
VideoPlaybackQuality(HTMLMediaElement* aElement, DOMHighResTimeStamp aCreationTime,
uint64_t aTotalFrames, uint64_t aDroppedFrames,
uint64_t aCorruptedFrames, double aTotalFrameDelay);
uint64_t aCorruptedFrames);
HTMLMediaElement* GetParentObject() const;
@ -49,18 +49,12 @@ public:
return mCorruptedFrames;
}
double TotalFrameDelay()
{
return mTotalFrameDelay;
}
private:
nsRefPtr<HTMLMediaElement> mElement;
DOMHighResTimeStamp mCreationTime;
uint64_t mTotalFrames;
uint64_t mDroppedFrames;
uint64_t mCorruptedFrames;
double mTotalFrameDelay;
};
} // namespace dom

View File

@ -21,7 +21,6 @@ function test() {
is(vpq.totalVideoFrames, 0, "totalVideoFrames should be 0");
is(vpq.droppedVideoFrames, 0, "droppedVideoFrames should be 0");
is(vpq.corruptedVideoFrames, 0, "corruptedVideoFrames should be 0");
is(vpq.totalFrameDelay, 0, "totalFrameDelay should be 0");
var vpq2 = video.getVideoPlaybackQuality();
ok(vpq !== vpq2, "getVideoPlaybackQuality should return a new object");
@ -38,7 +37,6 @@ function test() {
ok(vpq.totalVideoFrames > 0, "totalVideoFrames should be > 0");
ok(vpq.droppedVideoFrames >= 0, "droppedVideoFrames should be >= 0");
ok(vpq.corruptedVideoFrames >= 0, "corruptedVideoFrames should be >= 0");
ok(vpq.totalFrameDelay >= 0, "totalFrameDelay should be >= 0");
SpecialPowers.pushPrefEnv({"set": [["media.video_stats.enabled", false]]}, function () {
vpq = video.getVideoPlaybackQuality();
@ -46,7 +44,6 @@ function test() {
is(vpq.totalVideoFrames, 0, "totalVideoFrames should be 0");
is(vpq.droppedVideoFrames, 0, "droppedVideoFrames should be 0");
is(vpq.corruptedVideoFrames, 0, "corruptedVideoFrames should be 0");
is(vpq.totalFrameDelay, 0, "totalFrameDelay should be 0");
SimpleTest.finish();
});

View File

@ -84,45 +84,34 @@ UNIFIED_SOURCES += [
'MouseScrollEvent.cpp',
'MutationEvent.cpp',
'NotifyAudioAvailableEvent.cpp',
'NotifyPaintEvent.cpp',
'nsAsyncDOMEvent.cpp',
'nsContentEventHandler.cpp',
'nsDOMEvent.cpp',
'nsDOMEventTargetHelper.cpp',
'nsDOMTextEvent.cpp',
'nsEventDispatcher.cpp',
'nsEventListenerManager.cpp',
'nsEventListenerService.cpp',
'nsIMEStateManager.cpp',
'nsJSEventListener.cpp',
'nsPaintRequest.cpp',
'nsPrivateTextRange.cpp',
'PointerEvent.cpp',
'ScrollAreaEvent.cpp',
'SimpleGestureEvent.cpp',
'TextComposition.cpp',
'Touch.cpp',
'TouchEvent.cpp',
'TransitionEvent.cpp',
'UIEvent.cpp',
'WheelEvent.cpp',
'XULCommandEvent.cpp',
]
# nsEventStateManager.cpp should be built separately because of Mac OS X headers.
SOURCES += [
# nsDOMEvent.cpp should be built separately because it includes
# ipc/IPCMessageUtils.h, which on Windows includes windows.h.
'NotifyPaintEvent.cpp',
# nsDOMEvent.cpp should be built separately because it includes
# ipc/IPCMessageUtils.h, which on Windows includes windows.h.
'nsDOMEvent.cpp',
# nsDOMEvent.cpp should be built separately because it includes
# mozilla/HalSensor.h, which includes ipc/IPCMessageUtils.h, which
# on Windows includes windows.h.
'nsEventListenerManager.cpp',
# nsEventStateManager.cpp should be built separately because of Mac OS X headers.
'nsEventStateManager.cpp',
# nsDOMEvent.cpp should be built separately because it includes
# ipc/IPCMessageUtils.h, which on Windows includes windows.h.
'ScrollAreaEvent.cpp',
# nsDOMEvent.cpp should be built separately because it includes
# ipc/IPCMessageUtils.h, which on Windows includes windows.h.
'UIEvent.cpp',
]
if CONFIG['MOZ_WEBSPEECH']:

View File

@ -224,7 +224,7 @@ PluginHangUIParent::Init(const nsString& aPluginName)
}
commandLine.AppendLooseValue(ipcCookie);
ScopedHandle showEvent(::CreateEvent(nullptr, FALSE, FALSE, nullptr));
ScopedHandle showEvent(::CreateEventW(nullptr, FALSE, FALSE, nullptr));
if (!showEvent.IsValid()) {
return false;
}
@ -290,7 +290,7 @@ PluginHangUIParent::UnwatchHangUIChildProcess(bool aWait)
// constructor) completionEvent
ScopedHandle completionEvent;
if (aWait) {
completionEvent.Set(::CreateEvent(nullptr, FALSE, FALSE, nullptr));
completionEvent.Set(::CreateEventW(nullptr, FALSE, FALSE, nullptr));
if (!completionEvent.IsValid()) {
return false;
}

View File

@ -16,6 +16,6 @@ interface VideoPlaybackQuality {
readonly attribute unsigned long totalVideoFrames;
readonly attribute unsigned long droppedVideoFrames;
readonly attribute unsigned long corruptedVideoFrames;
readonly attribute double totalFrameDelay;
// At Risk: readonly attribute double totalFrameDelay;
};

View File

@ -11,16 +11,9 @@ ifdef _MSC_VER
ifeq (86,$(findstring 86,$(OS_TEST)))
USE_SSE2=1
MMX_CFLAGS=
ifneq (,$(filter 1400 1500, $(_MSC_VER)))
# MSVC 2005 and 2008 generate code that breaks alignment
# restrictions in debug mode so always optimize.
# See bug 640250 for more info.
SSE2_CFLAGS=-O2
else
SSE2_CFLAGS=
endif
endif
endif
ifdef GNU_CC
ifeq (ppc,$(findstring ppc,$(OS_TEST)))

View File

@ -162,7 +162,7 @@ public:
* Returns true if the context is using ANGLE. This should only be overridden
* for an ANGLE implementation.
*/
virtual bool IsANGLE() {
virtual bool IsANGLE() const {
return false;
}
@ -273,13 +273,11 @@ public:
/**
* If this context is double-buffered, returns TRUE.
*/
virtual bool IsDoubleBuffered() {
virtual bool IsDoubleBuffered() const {
return false;
}
virtual GLContextType GetContextType() {
return GLContextType::Unknown;
}
virtual GLContextType GetContextType() const = 0;
virtual bool IsCurrent() = 0;
@ -500,7 +498,7 @@ private:
// Robustness handling
public:
bool HasRobustness() {
bool HasRobustness() const {
return mHasRobustness;
}
@ -508,7 +506,7 @@ public:
* The derived class is expected to provide information on whether or not it
* supports robustness.
*/
virtual bool SupportsRobustness() = 0;
virtual bool SupportsRobustness() const = 0;
private:
@ -2460,15 +2458,13 @@ public:
// -----------------------------------------------------------------------------
// Everything that isn't standard GL APIs
protected:
typedef class gfx::SharedSurface SharedSurface;
typedef gfx::SharedSurfaceType SharedSurfaceType;
typedef gfx::SurfaceFormat SurfaceFormat;
virtual bool MakeCurrentImpl(bool aForce) = 0;
public:
virtual bool MakeCurrentImpl(bool aForce = false) = 0;
#ifdef MOZ_ENABLE_GL_TRACKING
static void StaticInit() {
PR_NewThreadPrivateIndex(&sCurrentGLContextTLS, nullptr);
@ -2548,7 +2544,7 @@ public:
*
* Only valid if IsOffscreen() returns true.
*/
virtual bool ResizeOffscreen(const gfx::IntSize& size) {
bool ResizeOffscreen(const gfx::IntSize& size) {
return ResizeScreenBuffer(size);
}
@ -2635,7 +2631,7 @@ public:
void ForceDirtyScreen();
void CleanDirtyScreen();
virtual GLenum GetPreferredARGB32Format() { return LOCAL_GL_RGBA; }
virtual GLenum GetPreferredARGB32Format() const { return LOCAL_GL_RGBA; }
virtual bool RenewSurface() { return false; }

View File

@ -34,7 +34,7 @@ public:
~GLContextCGL();
virtual GLContextType GetContextType() MOZ_OVERRIDE { return GLContextType::CGL; }
virtual GLContextType GetContextType() const MOZ_OVERRIDE { return GLContextType::CGL; }
static GLContextCGL* Cast(GLContext* gl) {
MOZ_ASSERT(gl->GetContextType() == GLContextType::CGL);
@ -46,21 +46,19 @@ public:
NSOpenGLContext* GetNSOpenGLContext() const { return mContext; }
CGLContextObj GetCGLContext() const;
bool MakeCurrentImpl(bool aForce = false);
virtual bool MakeCurrentImpl(bool aForce) MOZ_OVERRIDE;
virtual bool IsCurrent();
virtual bool IsCurrent() MOZ_OVERRIDE;
virtual GLenum GetPreferredARGB32Format() MOZ_OVERRIDE;
virtual GLenum GetPreferredARGB32Format() const MOZ_OVERRIDE;
bool SetupLookupFunction();
virtual bool SetupLookupFunction() MOZ_OVERRIDE;
bool IsDoubleBuffered();
virtual bool IsDoubleBuffered() const MOZ_OVERRIDE;
bool SupportsRobustness();
virtual bool SupportsRobustness() const MOZ_OVERRIDE;
bool SwapBuffers();
bool ResizeOffscreen(const gfx::IntSize& aNewSize);
virtual bool SwapBuffers() MOZ_OVERRIDE;
};
}

View File

@ -38,7 +38,7 @@ public:
~GLContextEGL();
virtual GLContextType GetContextType() MOZ_OVERRIDE { return GLContextType::EGL; }
virtual GLContextType GetContextType() const MOZ_OVERRIDE { return GLContextType::EGL; }
static GLContextEGL* Cast(GLContext* gl) {
MOZ_ASSERT(gl->GetContextType() == GLContextType::EGL);
@ -47,7 +47,7 @@ public:
bool Init();
bool IsDoubleBuffered() {
virtual bool IsDoubleBuffered() const MOZ_OVERRIDE {
return mIsDoubleBuffered;
}
@ -55,35 +55,31 @@ public:
mIsDoubleBuffered = aIsDB;
}
bool SupportsRobustness()
{
virtual bool SupportsRobustness() const MOZ_OVERRIDE {
return sEGLLibrary.HasRobustness();
}
virtual bool IsANGLE()
{
virtual bool IsANGLE() const MOZ_OVERRIDE {
return sEGLLibrary.IsANGLE();
}
bool BindTexImage();
virtual bool BindTexImage() MOZ_OVERRIDE;
bool ReleaseTexImage();
virtual bool ReleaseTexImage() MOZ_OVERRIDE;
void SetEGLSurfaceOverride(EGLSurface surf);
bool MakeCurrentImpl(bool aForce = false);
virtual bool MakeCurrentImpl(bool aForce) MOZ_OVERRIDE;
virtual bool IsCurrent();
virtual bool IsCurrent() MOZ_OVERRIDE;
virtual bool
RenewSurface();
virtual bool RenewSurface() MOZ_OVERRIDE;
virtual void
ReleaseSurface();
virtual void ReleaseSurface() MOZ_OVERRIDE;
bool SetupLookupFunction();
virtual bool SetupLookupFunction() MOZ_OVERRIDE;
bool SwapBuffers();
virtual bool SwapBuffers() MOZ_OVERRIDE;
// hold a reference to the given surface
// for the lifetime of this context.
@ -95,7 +91,6 @@ public:
bool BindTex2DOffscreen(GLContext *aOffscreen);
void UnbindTex2DOffscreen(GLContext *aOffscreen);
bool ResizeOffscreen(const gfx::IntSize& aNewSize);
void BindOffscreenFramebuffer();
static already_AddRefed<GLContextEGL>

View File

@ -28,7 +28,7 @@ public:
~GLContextGLX();
virtual GLContextType GetContextType() MOZ_OVERRIDE { return GLContextType::GLX; }
virtual GLContextType GetContextType() const MOZ_OVERRIDE { return GLContextType::GLX; }
static GLContextGLX* Cast(GLContext* gl) {
MOZ_ASSERT(gl->GetContextType() == GLContextType::GLX);
@ -37,17 +37,17 @@ public:
bool Init();
bool MakeCurrentImpl(bool aForce = false);
virtual bool MakeCurrentImpl(bool aForce) MOZ_OVERRIDE;
virtual bool IsCurrent();
virtual bool IsCurrent() MOZ_OVERRIDE;
bool SetupLookupFunction();
virtual bool SetupLookupFunction() MOZ_OVERRIDE;
bool IsDoubleBuffered();
virtual bool IsDoubleBuffered() const MOZ_OVERRIDE;
bool SupportsRobustness();
virtual bool SupportsRobustness() const MOZ_OVERRIDE;
bool SwapBuffers();
virtual bool SwapBuffers() MOZ_OVERRIDE;
private:
friend class GLContextProviderGLX;

View File

@ -151,7 +151,10 @@ GLContextCGL::IsCurrent() {
}
GLenum
GLContextCGL::GetPreferredARGB32Format() { return LOCAL_GL_BGRA; }
GLContextCGL::GetPreferredARGB32Format() const
{
return LOCAL_GL_BGRA;
}
bool
GLContextCGL::SetupLookupFunction()
@ -160,13 +163,13 @@ GLContextCGL::SetupLookupFunction()
}
bool
GLContextCGL::IsDoubleBuffered()
GLContextCGL::IsDoubleBuffered() const
{
return gUseDoubleBufferedWindows;
}
bool
GLContextCGL::SupportsRobustness()
GLContextCGL::SupportsRobustness() const
{
return false;
}
@ -180,12 +183,6 @@ GLContextCGL::SwapBuffers()
}
bool
GLContextCGL::ResizeOffscreen(const gfx::IntSize& aNewSize)
{
return ResizeScreenBuffer(aNewSize);
}
static GLContextCGL *
GetGlobalContextCGL()
{

View File

@ -547,12 +547,6 @@ TRY_AGAIN_POWER_OF_TWO:
return surface;
}
bool
GLContextEGL::ResizeOffscreen(const gfx::IntSize& aNewSize)
{
return ResizeScreenBuffer(aNewSize);
}
static const EGLint kEGLConfigAttribsOffscreenPBuffer[] = {
LOCAL_EGL_SURFACE_TYPE, LOCAL_EGL_PBUFFER_BIT,
LOCAL_EGL_RENDERABLE_TYPE, LOCAL_EGL_OPENGL_ES2_BIT,

View File

@ -885,13 +885,13 @@ GLContextGLX::SetupLookupFunction()
}
bool
GLContextGLX::IsDoubleBuffered()
GLContextGLX::IsDoubleBuffered() const
{
return mDoubleBuffered;
}
bool
GLContextGLX::SupportsRobustness()
GLContextGLX::SupportsRobustness() const
{
return mGLX->HasRobustness();
}

View File

@ -320,22 +320,25 @@ GLContextWGL::MakeCurrentImpl(bool aForce)
}
bool
GLContextWGL::IsCurrent() {
GLContextWGL::IsCurrent()
{
return sWGLLib.fGetCurrentContext() == mContext;
}
void
GLContextWGL::SetIsDoubleBuffered(bool aIsDB) {
GLContextWGL::SetIsDoubleBuffered(bool aIsDB)
{
mIsDoubleBuffered = aIsDB;
}
bool
GLContextWGL::IsDoubleBuffered() {
GLContextWGL::IsDoubleBuffered() const
{
return mIsDoubleBuffered;
}
bool
GLContextWGL::SupportsRobustness()
GLContextWGL::SupportsRobustness() const
{
return sWGLLib.HasRobustness();
}
@ -391,12 +394,6 @@ IsValidSizeForFormat(HDC hDC, int format,
return true;
}
bool
GLContextWGL::ResizeOffscreen(const gfx::IntSize& aNewSize)
{
return ResizeScreenBuffer(aNewSize);
}
static GLContextWGL *
GetGlobalContextWGL()
{

View File

@ -35,7 +35,7 @@ public:
~GLContextWGL();
virtual GLContextType GetContextType() MOZ_OVERRIDE { return GLContextType::WGL; }
virtual GLContextType GetContextType() const MOZ_OVERRIDE { return GLContextType::WGL; }
static GLContextWGL* Cast(GLContext* gl) {
MOZ_ASSERT(gl->GetContextType() == GLContextType::WGL);
@ -44,21 +44,19 @@ public:
bool Init();
bool MakeCurrentImpl(bool aForce = false);
virtual bool MakeCurrentImpl(bool aForce) MOZ_OVERRIDE;
virtual bool IsCurrent();
virtual bool IsCurrent() MOZ_OVERRIDE;
void SetIsDoubleBuffered(bool aIsDB);
virtual bool IsDoubleBuffered();
virtual bool IsDoubleBuffered() const MOZ_OVERRIDE;
bool SupportsRobustness();
virtual bool SupportsRobustness() const MOZ_OVERRIDE;
virtual bool SwapBuffers();
virtual bool SwapBuffers() MOZ_OVERRIDE;
bool SetupLookupFunction();
bool ResizeOffscreen(const gfx::IntSize& aNewSize);
virtual bool SetupLookupFunction() MOZ_OVERRIDE;
HGLRC Context() { return mContext; }

View File

@ -120,7 +120,7 @@ public:
Extensions_Max
};
bool IsExtensionSupported(EGLExtensions aKnownExtension) {
bool IsExtensionSupported(EGLExtensions aKnownExtension) const {
return mAvailableExtensions[aKnownExtension];
}
@ -411,7 +411,7 @@ public:
return mEGLDisplay;
}
bool IsANGLE() {
bool IsANGLE() const {
return mIsANGLE;
}
@ -431,7 +431,7 @@ public:
return IsExtensionSupported(ANGLE_surface_d3d_texture_2d_share_handle);
}
bool HasRobustness() {
bool HasRobustness() const {
return IsExtensionSupported(EXT_create_context_robustness);
}

View File

@ -7,7 +7,3 @@ include $(topsrcdir)/config/rules.mk
CFLAGS += $(GLIB_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS)
CXXFLAGS += $(GLIB_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS)
ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
LOCAL_INCLUDES += -I$(ANDROID_SOURCE)/hardware/libhardware_legacy/include
endif

View File

@ -188,3 +188,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
'/widget/gonk',
'/widget/xpwidgets'
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
CXXFLAGS += ['-I%s/hardware/libhardware_legacy/include' % CONFIG['ANDROID_SOURCE']]

View File

@ -511,6 +511,16 @@ char* Pickle::BeginWrite(uint32_t length, uint32_t alignment) {
DCHECK(intptr_t(buffer) % alignment == 0);
header_->payload_size = new_size;
#ifdef MOZ_VALGRIND
// pad the trailing end as well, so that valgrind
// doesn't complain when we write the buffer
padding = AlignInt(length) - length;
if (padding) {
memset(buffer + length, kBytePaddingMarker, padding);
}
#endif
return buffer;
}

View File

@ -303,4 +303,12 @@ class ProcessMetrics {
} // namespace base
#if defined(OS_WIN)
// Undo the windows.h damage
#undef GetMessage
#undef CreateEvent
#undef GetClassName
#undef GetBinaryType
#endif
#endif // BASE_PROCESS_UTIL_H_

View File

@ -79,11 +79,11 @@ Logging::Logging()
std::wstring event_name = GetEventName(browser_pid, true);
logging_event_on_.reset(new base::WaitableEvent(
CreateEvent(NULL, TRUE, FALSE, event_name.c_str())));
CreateEventW(NULL, TRUE, FALSE, event_name.c_str())));
event_name = GetEventName(browser_pid, false);
logging_event_off_.reset(new base::WaitableEvent(
CreateEvent(NULL, TRUE, FALSE, event_name.c_str())));
CreateEventW(NULL, TRUE, FALSE, event_name.c_str())));
RegisterWaitForEvent(true);
#endif

View File

@ -217,7 +217,7 @@ MessageChannel::MessageChannel(MessageListener *aListener)
&MessageChannel::OnMaybeDequeueOne));
#ifdef OS_WIN
mEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
mEvent = CreateEventW(nullptr, TRUE, FALSE, nullptr);
NS_ASSERTION(mEvent, "CreateEvent failed! Nothing is going to work!");
#endif
}

View File

@ -0,0 +1,3 @@
Array.buildPar(5, function() {
return [].t = encodeURI
})

View File

@ -9,6 +9,7 @@
#ifdef JS_ION
#include "jsfun.h"
#include "jsscript.h"
#include "jstypes.h"
@ -66,6 +67,17 @@ enum FrameType
IonFrame_Osr
};
enum ReadFrameArgsBehavior {
// Only read formals (i.e. [0 ... callee()->nargs]
ReadFrame_Formals,
// Only read overflown args (i.e. [callee()->nargs ... numActuals()]
ReadFrame_Overflown,
// Read all args (i.e. [0 ... numActuals()])
ReadFrame_Actuals
};
class IonCommonFrameLayout;
class IonJSFrameLayout;
class IonExitFrameLayout;
@ -205,15 +217,24 @@ class IonFrameIterator
MachineState machineState() const;
template <class Op>
void forEachCanonicalActualArg(Op op, unsigned start, unsigned count) const {
void forEachCanonicalActualArg(Op op, ReadFrameArgsBehavior behavior) const {
JS_ASSERT(isBaselineJS());
unsigned nactual = numActualArgs();
if (count == unsigned(-1))
count = nactual - start;
unsigned end = start + count;
JS_ASSERT(start <= end && end <= nactual);
unsigned start, end;
switch (behavior) {
case ReadFrame_Formals:
start = 0;
end = callee()->nargs();
break;
case ReadFrame_Overflown:
start = callee()->nargs();
end = nactual;
break;
case ReadFrame_Actuals:
start = 0;
end = nactual;
}
Value *argv = actualArgs();
for (unsigned i = start; i < end; i++)
@ -273,8 +294,8 @@ class SnapshotIterator : public SnapshotReader
}
template <class Op>
void readFrameArgs(Op &op, const Value *argv, Value *scopeChain, Value *thisv,
unsigned start, unsigned formalEnd, unsigned iterEnd, JSScript *script)
void readFrameArgs(Op &op, Value *scopeChain, Value *thisv,
unsigned start, unsigned end, JSScript *script)
{
if (scopeChain)
*scopeChain = read();
@ -294,22 +315,18 @@ class SnapshotIterator : public SnapshotReader
skip();
unsigned i = 0;
if (formalEnd < start)
if (end < start)
i = start;
for (; i < start; i++)
skip();
for (; i < formalEnd && i < iterEnd; i++) {
for (; i < end; i++) {
// We are not always able to read values from the snapshots, some values
// such as non-gc things may still be live in registers and cause an
// error while reading the machine state.
Value v = maybeRead();
op(v);
}
if (iterEnd >= formalEnd) {
for (; i < iterEnd; i++)
op(argv[i]);
}
}
Value maybeReadAllocByIndex(size_t index) {
@ -341,6 +358,10 @@ class InlineFrameIteratorMaybeGC
jsbytecode *pc_;
uint32_t numActualArgs_;
struct Nop {
void operator()(const Value &v) { }
};
private:
void findNextFrame();
@ -399,52 +420,67 @@ class InlineFrameIteratorMaybeGC
return frame_->numActualArgs();
}
template <class Op>
void forEachCanonicalActualArg(JSContext *cx, Op op, unsigned start, unsigned count) const {
template <class ArgOp, class LocalOp>
void readFrameArgsAndLocals(JSContext *cx, ArgOp &argOp, LocalOp &localOp,
Value *scopeChain, Value *thisv,
ReadFrameArgsBehavior behavior) const
{
unsigned nactual = numActualArgs();
if (count == unsigned(-1))
count = nactual - start;
unsigned end = start + count;
unsigned nformal = callee()->nargs();
JS_ASSERT(start <= end && end <= nactual);
if (more()) {
// There is still a parent frame of this inlined frame.
// The not overflown arguments are taken from the inlined frame,
// because it will have the updated value when JSOP_SETARG is done.
// All arguments (also the overflown) are the last pushed values in the parent frame.
// To get the overflown arguments, we need to take them from there.
// Get the non overflown arguments
unsigned formal_end = (end < nformal) ? end : nformal;
// Get the non overflown arguments, which are taken from the inlined
// frame, because it will have the updated value when JSOP_SETARG is
// done.
SnapshotIterator s(si_);
s.readFrameArgs(op, nullptr, nullptr, nullptr, start, nformal, formal_end, script());
if (behavior != ReadFrame_Overflown)
s.readFrameArgs(argOp, scopeChain, thisv, 0, nformal, script());
if (behavior != ReadFrame_Formals) {
if (more()) {
// There is still a parent frame of this inlined frame. All
// arguments (also the overflown) are the last pushed values
// in the parent frame. To get the overflown arguments, we
// need to take them from there.
// The overflown arguments are not available in current frame.
// They are the last pushed arguments in the parent frame of this inlined frame.
// They are the last pushed arguments in the parent frame of
// this inlined frame.
InlineFrameIteratorMaybeGC it(cx, this);
++it;
unsigned argsObjAdj = it.script()->argumentsHasVarBinding() ? 1 : 0;
SnapshotIterator parent_s(it.snapshotIterator());
// Skip over all slots untill we get to the last slots (= arguments slots of callee)
// the +3 is for [this], [returnvalue], [scopechain], and maybe +1 for [argsObj]
// Skip over all slots until we get to the last slots
// (= arguments slots of callee) the +3 is for [this], [returnvalue],
// [scopechain], and maybe +1 for [argsObj]
JS_ASSERT(parent_s.allocations() >= nactual + 3 + argsObjAdj);
unsigned skip = parent_s.allocations() - nactual - 3 - argsObjAdj;
for (unsigned j = 0; j < skip; j++)
parent_s.skip();
// Get the overflown arguments
parent_s.readFrameArgs(op, nullptr, nullptr, nullptr, nformal, nactual, end, it.script());
parent_s.readFrameArgs(argOp, nullptr, nullptr, nformal, nactual, it.script());
} else {
SnapshotIterator s(si_);
// There is no parent frame to this inlined frame, we can read
// from the frame's Value vector directly.
Value *argv = frame_->actualArgs();
s.readFrameArgs(op, argv, nullptr, nullptr, start, nformal, end, script());
for (unsigned i = nformal; i < nactual; i++)
argOp(argv[i]);
}
}
// At this point we've read all the formals in s, and can read the
// locals.
for (unsigned i = 0; i < script()->nfixed(); i++)
localOp(s.read());
}
template <class Op>
void forEachCanonicalActualArg(JSContext *cx, Op op, ReadFrameArgsBehavior behavior) const {
Nop nop;
readFrameArgsAndLocals(cx, op, nop, nullptr, nullptr, behavior);
}
JSScript *script() const {
return script_;
}

View File

@ -1829,7 +1829,7 @@ InlineFrameIteratorMaybeGC<allowGC>::dump() const
else {
if (i - 2 == callee()->nargs() && numActualArgs() > callee()->nargs()) {
DumpOp d(callee()->nargs());
forEachCanonicalActualArg(GetJSContextFromJitCode(), d, d.i_, numActualArgs() - d.i_);
forEachCanonicalActualArg(GetJSContextFromJitCode(), d, ReadFrame_Overflown);
}
fprintf(stderr, " slot %d: ", int(i - 2 - callee()->nargs()));

View File

@ -1094,7 +1094,20 @@ ArrayJoin(JSContext *cx, CallArgs &args)
JS::Anchor<JSString*> anchor(sepstr);
// Step 6 is implicit in the loops below
// Step 6 is implicit in the loops below.
// An optimized version of a special case of steps 7-11: when length==1 and
// the 0th element is a string, ToString() of that element is a no-op and
// so it can be immediately returned as the result.
if (length == 1 && !Locale && obj->is<ArrayObject>() &&
obj->getDenseInitializedLength() == 1)
{
const Value &elem0 = obj->getDenseElement(0);
if (elem0.isString()) {
args.rval().setString(elem0.toString());
return true;
}
}
StringBuffer sb(cx);
@ -1103,7 +1116,7 @@ ArrayJoin(JSContext *cx, CallArgs &args)
if (length > 0 && !sb.reserve(seplen * (length - 1)))
return false;
// Various optimized versions of steps 7-10
// Various optimized versions of steps 7-10.
if (seplen == 0) {
EmptySeparatorOp op;
if (!ArrayJoinKernel<Locale>(cx, op, obj, length, sb))

View File

@ -966,7 +966,7 @@ PushBaselineFunApplyArguments(JSContext *cx, jit::IonFrameIterator &frame, Invok
args.setThis(vp[2]);
/* Steps 7-8. */
frame.forEachCanonicalActualArg(CopyTo(args.array()), 0, -1);
frame.forEachCanonicalActualArg(CopyTo(args.array()), jit::ReadFrame_Actuals);
return true;
}
#endif
@ -1024,7 +1024,8 @@ js_fun_apply(JSContext *cx, unsigned argc, Value *vp)
args.setThis(vp[2]);
/* Steps 7-8. */
iter.forEachCanonicalActualArg(cx, CopyTo(args.array()), 0, -1);
iter.forEachCanonicalActualArg(cx, CopyTo(args.array()),
jit::ReadFrame_Actuals);
} else {
JS_ASSERT(frame.isBaselineStub());

View File

@ -36,6 +36,7 @@
#include "jit/BaselineJIT.h"
#include "jit/IonCode.h"
#include "js/OldDebugAPI.h"
#include "js/Utility.h"
#include "vm/ArgumentsObject.h"
#include "vm/Compression.h"
#include "vm/Debugger.h"
@ -3582,12 +3583,9 @@ LazyScript::CreateRaw(ExclusiveContext *cx, HandleFunction fun,
size_t bytes = (p.numFreeVariables * sizeof(HeapPtrAtom))
+ (p.numInnerFunctions * sizeof(HeapPtrFunction));
void *table = nullptr;
if (bytes) {
table = cx->malloc_(bytes);
if (!table)
ScopedJSFreePtr<void> table(bytes ? cx->malloc_(bytes) : nullptr);
if (bytes && !table)
return nullptr;
}
LazyScript *res = js_NewGCLazyScript(cx);
if (!res)
@ -3595,7 +3593,7 @@ LazyScript::CreateRaw(ExclusiveContext *cx, HandleFunction fun,
cx->compartment()->scheduleDelazificationForDebugMode();
return new (res) LazyScript(fun, table, packed, begin, end, lineno, column);
return new (res) LazyScript(fun, table.forget(), packed, begin, end, lineno, column);
}
/* static */ LazyScript *

View File

@ -664,9 +664,10 @@ ArrayBufferObject::addView(ArrayBufferViewObject *view)
}
ArrayBufferObject *
ArrayBufferObject::create(JSContext *cx, uint32_t nbytes, bool clear /* = true */)
ArrayBufferObject::create(JSContext *cx, uint32_t nbytes, bool clear /* = true */,
NewObjectKind newKind /* = GenericObject */)
{
Rooted<ArrayBufferObject*> obj(cx, NewBuiltinClassInstance<ArrayBufferObject>(cx));
Rooted<ArrayBufferObject*> obj(cx, NewBuiltinClassInstance<ArrayBufferObject>(cx, newKind));
if (!obj)
return nullptr;
JS_ASSERT_IF(obj->isTenured(), obj->tenuredGetAllocKind() == gc::FINALIZE_OBJECT16_BACKGROUND);
@ -1350,7 +1351,11 @@ JS_PUBLIC_API(JSObject *)
JS_NewArrayBufferWithContents(JSContext *cx, void *contents)
{
JS_ASSERT(contents);
JSObject *obj = ArrayBufferObject::create(cx, 0);
// Do not allocate ArrayBuffers with an API-provided pointer in the nursery.
// These are likely to be long lived and the nursery does not know how to
// free the contents.
JSObject *obj = ArrayBufferObject::create(cx, 0, true, TenuredObject);
if (!obj)
return nullptr;
js::ObjectElements *elements = reinterpret_cast<js::ObjectElements *>(contents);

View File

@ -67,7 +67,8 @@ class ArrayBufferObject : public JSObject
static bool class_constructor(JSContext *cx, unsigned argc, Value *vp);
static ArrayBufferObject *create(JSContext *cx, uint32_t nbytes, bool clear = true);
static ArrayBufferObject *create(JSContext *cx, uint32_t nbytes, bool clear = true,
NewObjectKind newKind = GenericObject);
static JSObject *createSlice(JSContext *cx, Handle<ArrayBufferObject*> arrayBuffer,
uint32_t begin, uint32_t end);

View File

@ -870,7 +870,7 @@ JSRuntime::clearUsedByExclusiveThread(Zone *zone)
bool
js::CurrentThreadCanAccessRuntime(JSRuntime *rt)
{
return rt->ownerThread_ == PR_GetCurrentThread() || InExclusiveParallelSection();
return rt->ownerThread_ == PR_GetCurrentThread() && !InParallelSection();
}
bool

View File

@ -330,10 +330,10 @@ ScriptFrameIter::ionForEachCanonicalActualArg(JSContext *cx, Op op)
JS_ASSERT(isJit());
#ifdef JS_ION
if (data_.ionFrames_.isOptimizedJS()) {
ionInlineFrames_.forEachCanonicalActualArg(cx, op, 0, -1);
ionInlineFrames_.forEachCanonicalActualArg(cx, op, jit::ReadFrame_Actuals);
} else {
JS_ASSERT(data_.ionFrames_.isBaselineJS());
data_.ionFrames_.forEachCanonicalActualArg(op, 0, -1);
data_.ionFrames_.forEachCanonicalActualArg(op, jit::ReadFrame_Actuals);
}
#endif
}

View File

@ -53,7 +53,7 @@ private:
JS::TenuredHeap<JSObject*> mGlobal;
};
NS_EXPORT nsresult
nsresult
NS_NewBackstagePass(BackstagePass** ret);
#endif // BackstagePass_h__

View File

@ -1304,7 +1304,7 @@ XPCJSRuntime::GetWatchdogTimestamp(WatchdogTimestampCategory aCategory)
return mWatchdogManager->GetTimestamp(aCategory);
}
NS_EXPORT_(void)
void
xpc::SimulateActivityCallback(bool aActive)
{
XPCJSRuntime::ActivityCallback(XPCJSRuntime::Get(), aActive);

View File

@ -249,7 +249,7 @@ private:
#endif
};
NS_EXPORT_(bool)
bool
xpc_LocalizeRuntime(JSRuntime *rt)
{
JS_SetLocaleCallbacks(rt, new XPCLocaleCallbacks());
@ -273,7 +273,7 @@ xpc_LocalizeRuntime(JSRuntime *rt)
return !!JS_SetDefaultLocale(rt, locale.get());
}
NS_EXPORT_(void)
void
xpc_DelocalizeRuntime(JSRuntime *rt)
{
XPCLocaleCallbacks* lc = XPCLocaleCallbacks::This(rt);

View File

@ -1282,7 +1282,7 @@ XPCShellErrorReporter(JSContext *cx, const char *message, JSErrorReport *rep)
gExitCode = EXITCODE_RUNTIME_ERROR;
// Delegate to the system error reporter for heavy lifting.
xpc::SystemErrorReporterExternal(cx, message, rep);
xpc::SystemErrorReporter(cx, message, rep);
}
static bool

View File

@ -15,9 +15,6 @@
using mozilla::dom::EventTarget;
using mozilla::DebugOnly;
NS_EXPORT
nsCxPusher::~nsCxPusher() {}
bool
nsCxPusher::Push(EventTarget *aCurrentTarget)
{
@ -78,7 +75,7 @@ nsCxPusher::RePush(EventTarget *aCurrentTarget)
return Push(aCurrentTarget);
}
NS_EXPORT_(void)
void
nsCxPusher::Push(JSContext *cx)
{
mPusher.construct(cx);
@ -92,7 +89,7 @@ nsCxPusher::PushNull()
mPusher.construct(static_cast<JSContext*>(nullptr), /* aAllowNull = */ true);
}
NS_EXPORT_(void)
void
nsCxPusher::Pop()
{
if (!mPusher.empty())
@ -135,7 +132,6 @@ AutoCxPusher::AutoCxPusher(JSContext* cx, bool allowNull)
}
}
NS_EXPORT
AutoCxPusher::~AutoCxPusher()
{
// GC when we pop a script entry point. This is a useful heuristic that helps

View File

@ -27,7 +27,7 @@ class MOZ_STACK_CLASS AutoCxPusher
public:
AutoCxPusher(JSContext *aCx, bool aAllowNull = false);
// XPCShell uses an nsCxPusher, which contains an AutoCxPusher.
NS_EXPORT ~AutoCxPusher();
~AutoCxPusher();
nsIScriptContext* GetScriptContext() { return mScx; }
@ -63,14 +63,6 @@ private:
class MOZ_STACK_CLASS nsCxPusher
{
public:
// This destructor doesn't actually do anything, but it implicitly depends on
// the Maybe<AutoCxPusher> destructor, which in turn depends on the
// ~AutoCxPusher destructor. If we stick with the default destructor, the
// caller needs to be able to link against the AutoCxPusher destructor, which
// isn't possible with externally-linked consumers like xpcshell. Hoist this
// work into nsCxPusher.cpp and use NS_EXPORT to make it all work right.
NS_EXPORT ~nsCxPusher();
// Returns false if something erroneous happened.
bool Push(mozilla::dom::EventTarget *aCurrentTarget);
// If nothing has been pushed to stack, this works like Push.
@ -78,12 +70,12 @@ public:
bool RePush(mozilla::dom::EventTarget *aCurrentTarget);
// If a null JSContext is passed to Push(), that will cause no
// push to happen and false to be returned.
NS_EXPORT_(void) Push(JSContext *cx);
void Push(JSContext *cx);
// Explicitly push a null JSContext on the the stack
void PushNull();
// Pop() will be a no-op if Push() or PushNull() fail
NS_EXPORT_(void) Pop();
void Pop();
nsIScriptContext* GetCurrentScriptContext() {
return mPusher.empty() ? nullptr : mPusher.ref().GetScriptContext();

View File

@ -233,13 +233,6 @@ xpc::SystemErrorReporter(JSContext *cx, const char *message, JSErrorReport *rep)
}
NS_EXPORT_(void)
xpc::SystemErrorReporterExternal(JSContext *cx, const char *message,
JSErrorReport *rep)
{
return SystemErrorReporter(cx, message, rep);
}
/***************************************************************************/
@ -1221,7 +1214,7 @@ nsXPConnect::CheckForDebugMode(JSRuntime *rt)
#endif //#ifdef MOZ_JSDEBUGGER
NS_EXPORT_(void)
void
xpc_ActivateDebugMode()
{
XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
@ -1310,7 +1303,7 @@ nsXPConnect::HoldObject(JSContext *aJSContext, JSObject *aObjectArg,
namespace xpc {
NS_EXPORT_(bool)
bool
Base64Encode(JSContext *cx, HandleValue val, MutableHandleValue out)
{
MOZ_ASSERT(cx);
@ -1336,7 +1329,7 @@ Base64Encode(JSContext *cx, HandleValue val, MutableHandleValue out)
return true;
}
NS_EXPORT_(bool)
bool
Base64Decode(JSContext *cx, HandleValue val, MutableHandleValue out)
{
MOZ_ASSERT(cx);

View File

@ -3620,9 +3620,9 @@ DefineStaticJSVals(JSContext *cx);
} // namespace dom
} // namespace mozilla
NS_EXPORT_(bool)
bool
xpc_LocalizeRuntime(JSRuntime *rt);
NS_EXPORT_(void)
void
xpc_DelocalizeRuntime(JSRuntime *rt);
/***************************************************************************/

View File

@ -173,7 +173,7 @@ xpc_UnmarkSkippableJSHolders();
// No JS can be on the stack when this is called. Probably only useful from
// xpcshell.
NS_EXPORT_(void)
void
xpc_ActivateDebugMode();
// readable string conversions, static methods and members only
@ -259,8 +259,8 @@ private:
namespace xpc {
// If these functions return false, then an exception will be set on cx.
NS_EXPORT_(bool) Base64Encode(JSContext *cx, JS::HandleValue val, JS::MutableHandleValue out);
NS_EXPORT_(bool) Base64Decode(JSContext *cx, JS::HandleValue val, JS::MutableHandleValue out);
bool Base64Encode(JSContext *cx, JS::HandleValue val, JS::MutableHandleValue out);
bool Base64Decode(JSContext *cx, JS::HandleValue val, JS::MutableHandleValue out);
/**
* Convert an nsString to jsval, returning true on success.
@ -427,15 +427,7 @@ WindowGlobalOrNull(JSObject *aObj);
void
SystemErrorReporter(JSContext *cx, const char *message, JSErrorReport *rep);
// We have a separate version that's exported with external linkage for use by
// xpcshell, since external linkage on windows changes the signature to make it
// incompatible with the JSErrorReporter type, causing JS_SetErrorReporter calls
// to fail to compile.
NS_EXPORT_(void)
SystemErrorReporterExternal(JSContext *cx, const char *message,
JSErrorReport *rep);
NS_EXPORT_(void)
void
SimulateActivityCallback(bool aActive);
void

View File

@ -1984,27 +1984,64 @@ nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState,
return newFrame;
}
static void
MakeTablePartAbsoluteContainingBlockIfNeeded(nsFrameConstructorState& aState,
const nsStyleDisplay* aDisplay,
nsFrameConstructorSaveState& aAbsSaveState,
nsIFrame* aFrame)
{
// If we're positioned, then we need to become an absolute containing block
// for any absolutely positioned children and register for post-reflow fixup.
//
// Note that usually if a frame type can be an absolute containing block, we
// always set NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN, whether it actually is or not.
// However, in this case flag serves the additional purpose of indicating that
// the frame was registered with its table frame. This allows us to avoid the
// overhead of unregistering the frame in most cases.
if (aDisplay->IsRelativelyPositionedStyle() ||
aDisplay->IsAbsolutelyPositionedStyle() ||
aDisplay->HasTransform(aFrame)) {
aFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
aState.PushAbsoluteContainingBlock(aFrame, aFrame, aAbsSaveState);
nsTableFrame::RegisterPositionedTablePart(aFrame);
}
}
nsIFrame*
nsCSSFrameConstructor::ConstructTableRow(nsFrameConstructorState& aState,
nsCSSFrameConstructor::ConstructTableRowOrRowGroup(nsFrameConstructorState& aState,
FrameConstructionItem& aItem,
nsIFrame* aParentFrame,
const nsStyleDisplay* aDisplay,
nsFrameItems& aFrameItems)
{
NS_PRECONDITION(aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_ROW,
NS_PRECONDITION(aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_ROW ||
aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_ROW_GROUP ||
aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP ||
aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_HEADER_GROUP,
"Unexpected call");
MOZ_ASSERT(aItem.mStyleContext->StyleDisplay() == aDisplay,
"Display style doesn't match style context");
nsIContent* const content = aItem.mContent;
nsStyleContext* const styleContext = aItem.mStyleContext;
const uint32_t nameSpaceID = aItem.mNameSpaceID;
nsIFrame* newFrame;
if (aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_ROW) {
if (kNameSpaceID_MathML == nameSpaceID)
newFrame = NS_NewMathMLmtrFrame(mPresShell, styleContext);
else
newFrame = NS_NewTableRowFrame(mPresShell, styleContext);
} else {
newFrame = NS_NewTableRowGroupFrame(mPresShell, styleContext);
}
InitAndRestoreFrame(aState, content, aParentFrame, newFrame);
nsFrameConstructorSaveState absoluteSaveState;
MakeTablePartAbsoluteContainingBlockIfNeeded(aState, aDisplay,
absoluteSaveState,
newFrame);
nsFrameItems childItems;
NS_ASSERTION(aItem.mAnonChildren.IsEmpty(),
"nsIAnonymousContentCreator::CreateAnonymousContent "
@ -2107,6 +2144,11 @@ nsCSSFrameConstructor::ConstructTableCell(nsFrameConstructorState& aState,
InitAndRestoreFrame(aState, content, newFrame, cellInnerFrame);
nsFrameConstructorSaveState absoluteSaveState;
MakeTablePartAbsoluteContainingBlockIfNeeded(aState, aDisplay,
absoluteSaveState,
newFrame);
nsFrameItems childItems;
NS_ASSERTION(aItem.mAnonChildren.IsEmpty(),
"nsIAnonymousContentCreator::CreateAnonymousContent "
@ -4393,20 +4435,17 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
NS_NewTableCaptionFrame) },
{ NS_STYLE_DISPLAY_TABLE_ROW_GROUP,
FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_DISALLOW_OUT_OF_FLOW |
FCDATA_SKIP_ABSPOS_PUSH |
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
NS_NewTableRowGroupFrame) },
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup) },
{ NS_STYLE_DISPLAY_TABLE_HEADER_GROUP,
FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_DISALLOW_OUT_OF_FLOW |
FCDATA_SKIP_ABSPOS_PUSH |
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
NS_NewTableRowGroupFrame) },
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup) },
{ NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP,
FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_DISALLOW_OUT_OF_FLOW |
FCDATA_SKIP_ABSPOS_PUSH |
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
NS_NewTableRowGroupFrame) },
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup) },
{ NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP,
FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_DISALLOW_OUT_OF_FLOW |
FCDATA_SKIP_ABSPOS_PUSH |
@ -4419,7 +4458,7 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
{ NS_STYLE_DISPLAY_TABLE_ROW,
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRowGroup),
&nsCSSFrameConstructor::ConstructTableRow) },
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup) },
{ NS_STYLE_DISPLAY_TABLE_CELL,
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRow),
@ -7993,8 +8032,16 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell,
nullptr);
state.mCreatingExtraFrames = true;
nsStyleContext* const headerFooterStyleContext = rowGroupFrame->StyleContext();
headerFooterFrame = static_cast<nsTableRowGroupFrame*>
(NS_NewTableRowGroupFrame(aPresShell, rowGroupFrame->StyleContext()));
(NS_NewTableRowGroupFrame(aPresShell, headerFooterStyleContext));
nsFrameConstructorSaveState absoluteSaveState;
MakeTablePartAbsoluteContainingBlockIfNeeded(state,
headerFooterStyleContext->StyleDisplay(),
absoluteSaveState,
headerFooterFrame);
nsIContent* headerFooter = rowGroupFrame->GetContent();
headerFooterFrame->Init(headerFooter, newFrame, nullptr);
ProcessChildren(state, headerFooter, rowGroupFrame->StyleContext(),
@ -8071,10 +8118,16 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
} else if (nsGkAtoms::tableRowGroupFrame == frameType) {
newFrame = NS_NewTableRowGroupFrame(shell, styleContext);
newFrame->Init(content, aParentFrame, aFrame);
if (newFrame->GetStateBits() & NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN) {
nsTableFrame::RegisterPositionedTablePart(newFrame);
}
} else if (nsGkAtoms::tableRowFrame == frameType) {
newFrame = NS_NewTableRowFrame(shell, styleContext);
newFrame->Init(content, aParentFrame, aFrame);
if (newFrame->GetStateBits() & NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN) {
nsTableFrame::RegisterPositionedTablePart(newFrame);
}
// Create a continuing frame for each table cell frame
nsFrameItems newChildList;
@ -8099,6 +8152,9 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
newFrame = NS_NewTableCellFrame(shell, styleContext, IsBorderCollapse(aParentFrame));
newFrame->Init(content, aParentFrame, aFrame);
if (newFrame->GetStateBits() & NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN) {
nsTableFrame::RegisterPositionedTablePart(newFrame);
}
// Create a continuing area frame
nsIFrame* blockFrame = aFrame->GetFirstPrincipalChild();
@ -8799,15 +8855,14 @@ nsCSSFrameConstructor::sPseudoParentData[eParentTypeCount] = {
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
FCDATA_USE_CHILD_ITEMS |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRowGroup),
&nsCSSFrameConstructor::ConstructTableRow),
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup),
&nsCSSAnonBoxes::tableRow
},
{ // Row group
FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
FCDATA_DISALLOW_OUT_OF_FLOW | FCDATA_USE_CHILD_ITEMS |
FCDATA_SKIP_ABSPOS_PUSH |
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
FCDATA_USE_CHILD_ITEMS |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
NS_NewTableRowGroupFrame),
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup),
&nsCSSAnonBoxes::tableRowGroup
},
{ // Column group

View File

@ -383,9 +383,9 @@ private:
nsFrameItems& aFrameItems);
/**
* FrameConstructionData callback used for constructing table rows.
* FrameConstructionData callback for constructing table rows and row groups.
*/
nsIFrame* ConstructTableRow(nsFrameConstructorState& aState,
nsIFrame* ConstructTableRowOrRowGroup(nsFrameConstructorState& aState,
FrameConstructionItem& aItem,
nsIFrame* aParentFrame,
const nsStyleDisplay* aStyleDisplay,

View File

@ -5117,12 +5117,39 @@ nsIFrame::GetOverflowAreas() const
nsRect(nsPoint(0, 0), GetSize()));
}
nsOverflowAreas
nsIFrame::GetOverflowAreasRelativeToSelf() const
{
if (IsTransformed()) {
nsOverflowAreas* preTransformOverflows = static_cast<nsOverflowAreas*>
(Properties().Get(PreTransformOverflowAreasProperty()));
if (preTransformOverflows) {
return nsOverflowAreas(preTransformOverflows->VisualOverflow(),
preTransformOverflows->ScrollableOverflow());
}
}
return nsOverflowAreas(GetVisualOverflowRect(),
GetScrollableOverflowRect());
}
nsRect
nsIFrame::GetScrollableOverflowRectRelativeToParent() const
{
return GetScrollableOverflowRect() + mRect.TopLeft();
}
nsRect
nsIFrame::GetScrollableOverflowRectRelativeToSelf() const
{
if (IsTransformed()) {
nsOverflowAreas* preTransformOverflows = static_cast<nsOverflowAreas*>
(Properties().Get(PreTransformOverflowAreasProperty()));
if (preTransformOverflows)
return preTransformOverflows->ScrollableOverflow();
}
return GetScrollableOverflowRect();
}
nsRect
nsIFrame::GetVisualOverflowRectRelativeToSelf() const
{

View File

@ -2235,6 +2235,15 @@ public:
nsOverflowAreas GetOverflowAreas() const;
/**
* Same as GetOverflowAreas, except in this frame's coordinate
* system (before transforms are applied).
*
* @return the overflow areas relative to this frame, before any CSS transforms have
* been applied, i.e. in this frame's coordinate system
*/
nsOverflowAreas GetOverflowAreasRelativeToSelf() const;
/**
* Same as GetScrollableOverflowRect, except relative to the parent
* frame.
@ -2244,6 +2253,15 @@ public:
*/
nsRect GetScrollableOverflowRectRelativeToParent() const;
/**
* Same as GetScrollableOverflowRect, except in this frame's coordinate
* system (before transforms are applied).
*
* @return the rect relative to this frame, before any CSS transforms have
* been applied, i.e. in this frame's coordinate system
*/
nsRect GetScrollableOverflowRectRelativeToSelf() const;
/**
* Like GetVisualOverflowRect, except in this frame's
* coordinate system (before transforms are applied).

View File

@ -5,6 +5,26 @@ fuzzy-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated&&!azur
== table-1.html table-1-ref.html
== table-2.html table-2-ref.html
== table-3.html table-3-ref.html
== table-cell-1.html table-internal-1-ref.html
== table-cell-2.html table-internal-2-ref.html
== table-cell-3.html table-internal-3-ref.html
== table-cell-4.html table-internal-4-ref.html
== table-row-1.html table-internal-1-ref.html
== table-row-2.html table-internal-2-ref.html
== table-row-3.html table-internal-3-ref.html
== table-row-4.html table-internal-4-ref.html
== table-row-group-1.html table-internal-1-ref.html
== table-row-group-2.html table-internal-2-ref.html
== table-row-group-3.html table-internal-3-ref.html
== table-row-group-4.html table-internal-4-ref.html
== table-header-group-1.html table-internal-1-ref.html
== table-header-group-2.html table-internal-2-ref.html
== table-header-group-3.html table-internal-3-ref.html
== table-header-group-4.html table-internal-4-ref.html
== table-footer-group-1.html table-internal-1-ref.html
== table-footer-group-2.html table-internal-2-ref.html
== table-footer-group-3.html table-internal-3-ref.html
== table-footer-group-4.html table-internal-4-ref.html
== continuation-positioned-inline-1.html continuation-positioned-inline-ref.html
== continuation-positioned-inline-2.html continuation-positioned-inline-ref.html
== scrollframe-1.html scrollframe-1-ref.html

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<style>
#rel {
position: relative;
margin: 0;
padding: 0;
}
.abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
#bad {
background-color: blue;
}
</style>
</head>
<body>
The green square should not completely cover the blue square.
<div class="abs" id="bad"></div>
<table>
<tr>
<td id="rel">
<div class="abs"></div>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<style>
#rel {
position: relative;
margin: 0;
padding: 0;
}
.abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
#bad {
background-color: blue;
}
</style>
</head>
<body>
The green square should not completely cover the blue square.
<div class="abs" id="bad"></div>
<div style="position: relative">
<table>
<tr>
<td id="rel">
<div class="abs"></div>
</td>
</tr>
</table>
</div>
</body>
</html>

View File

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 300px;
height: 300px;
background-color: blue;
}
td {
margin: 0;
padding: 0;
}
#rel {
position: relative;
margin: 0;
padding: 0;
}
#abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
</style>
</head>
<body>
The green square should not touch the blue square.
<table>
<tr>
<td></td>
<td></td>
</tr>
<tr style="height: 100%">
<td></td>
<td></td>
</tr>
<tr>
<td id="rel">
<div id="abs"></div>
</td>
<td></td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 300px;
height: 300px;
background-color: blue;
}
td, div {
margin: 0;
padding: 0;
}
#rel {
position: relative;
margin: 0;
padding: 0;
}
#abs {
position: absolute;
margin: 0;
padding: 0;
top: 200px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
</style>
</head>
<body>
The green square should not touch the blue square.
<table>
<colgroup>
<col style="width: 15%">
<col>
</colgroup>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td id="rel">
<div id="abs"></div>
</td>
<td></td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<style>
#rel {
position: relative;
margin: 0;
padding: 0;
}
.abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
#bad {
background-color: blue;
}
</style>
</head>
<body>
The green square should not completely cover the blue square.
<div class="abs" id="bad"></div>
<table>
<tfoot id="rel">
<tr>
<td>
<div class="abs"></div>
</td>
</tr>
</tfoot>
</table>
</body>
</html>

View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<style>
#rel {
position: relative;
margin: 0;
padding: 0;
}
.abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
#bad {
background-color: blue;
}
</style>
</head>
<body>
The green square should not completely cover the blue square.
<div class="abs" id="bad"></div>
<div style="position: relative">
<table>
<tfoot id="rel">
<tr>
<td>
<div class="abs"></div>
</td>
</tr>
</tfoot>
</table>
</div>
</body>
</html>

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 300px;
height: 300px;
background-color: blue;
}
td {
margin: 0;
padding: 0;
}
#rel {
position: relative;
margin: 0;
padding: 0;
}
#abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
</style>
</head>
<body>
The green square should not touch the blue square.
<table>
<tbody>
<tr>
<td></td>
<td></td>
</tr>
<tr style="height: 100%">
<td></td>
<td></td>
</tr>
</tbody>
<tfoot id="rel">
<tr>
<td></td>
<td>
<div id="abs"></div>
</td>
</tr>
</tfoot>
</table>
</body>
</html>

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 300px;
height: 300px;
background-color: blue;
}
td {
margin: 0;
padding: 0;
}
#rel {
position: relative;
margin: 0;
padding: 0;
}
#abs {
position: absolute;
margin: 0;
padding: 0;
top: 200px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
</style>
</head>
<body>
The green square should not touch the blue square.
<table>
<colgroup>
<col style="width: 15%">
<col>
</colgroup>
<tbody>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
<tfoot id="rel">
<tr>
<td></td>
<td>
<div id="abs"></div>
</td>
</tr>
</tfoot>
</table>
</body>
</html>

View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<style>
#rel {
position: relative;
margin: 0;
padding: 0;
}
.abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
#bad {
background-color: blue;
}
</style>
</head>
<body>
The green square should not completely cover the blue square.
<div class="abs" id="bad"></div>
<table>
<thead id="rel">
<tr>
<td>
<div class="abs"></div>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<style>
#rel {
position: relative;
margin: 0;
padding: 0;
}
.abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
#bad {
background-color: blue;
}
</style>
</head>
<body>
The green square should not completely cover the blue square.
<div class="abs" id="bad"></div>
<div style="position: relative">
<table>
<thead id="rel">
<tr>
<td>
<div class="abs"></div>
</td>
</tr>
</thead>
</table>
</div>
</body>
</html>

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 300px;
height: 300px;
background-color: blue;
}
td {
margin: 0;
padding: 0;
}
#rel {
position: relative;
margin: 0;
padding: 0;
}
#abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
</style>
</head>
<body>
The green square should not touch the blue square.
<table>
<thead>
<tr>
<td></td>
<td></td>
</tr>
<tr style="height: 100%">
<td></td>
<td></td>
</tr>
</thead>
<thead id="rel">
<tr>
<td></td>
<td>
<div id="abs"></div>
</td>
</tr>
</thead>
</table>
</body>
</html>

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 300px;
height: 300px;
background-color: blue;
}
td {
margin: 0;
padding: 0;
}
#rel {
position: relative;
margin: 0;
padding: 0;
}
#abs {
position: absolute;
margin: 0;
padding: 0;
top: 200px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
</style>
</head>
<body>
The green square should not touch the blue square.
<table>
<colgroup>
<col style="width: 15%">
<col>
</colgroup>
<thead>
<tr>
<td></td>
<td></td>
</tr>
</thead>
<thead id="rel">
<tr>
<td></td>
<td>
<div id="abs"></div>
</td>
</tr>
</thead>
</table>
</body>
</html>

View File

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<style>
#rel {
position: relative;
margin: 2px;
padding: 0;
}
.abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
#bad {
background-color: blue;
}
</style>
</head>
<body>
The green square should not completely cover the blue square.
<div class="abs" id="bad"></div>
<div id="rel">
<div class="abs"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<style>
#rel {
position: relative;
margin: 2px;
padding: 0;
}
.abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
#bad {
background-color: blue;
}
</style>
</head>
<body>
The green square should not completely cover the blue square.
<div class="abs" id="bad"></div>
<div style="position: relative">
<div id="rel">
<div class="abs"></div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 300px;
height: 300px;
background-color: blue;
}
td {
margin: 0;
padding: 0;
}
#rel {
position: relative;
margin: 0;
padding: 0;
}
#abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
</style>
</head>
<body>
The green square should not touch the blue square.
<table>
<tr>
<td></td>
<td></td>
</tr>
<tr style="height: 100%">
<td></td>
<td></td>
</tr>
<tr>
<td>
<div id="rel">
<div id="abs"></div>
</div>
</td>
<td></td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 300px;
height: 300px;
background-color: blue;
}
td, div {
margin: 0;
padding: 0;
}
#rel {
position: relative;
margin: 0;
padding: 0;
height: 1px;
}
#abs {
position: absolute;
margin: 0;
padding: 0;
top: 200.5px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
</style>
</head>
<body>
The green square should not touch the blue square.
<table>
<colgroup>
<col style="width: 15%">
<col>
</colgroup>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>
<div id="rel">
<div id="abs"></div>
</div>
</td>
<td></td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<style>
#rel {
position: relative;
margin: 0;
padding: 0;
}
.abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
#bad {
background-color: blue;
}
</style>
</head>
<body>
The green square should not completely cover the blue square.
<div class="abs" id="bad"></div>
<table>
<tr id="rel">
<td>
<div class="abs"></div>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<style>
#rel {
position: relative;
margin: 0;
padding: 0;
}
.abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
#bad {
background-color: blue;
}
</style>
</head>
<body>
The green square should not completely cover the blue square.
<div class="abs" id="bad"></div>
<div style="position: relative">
<table>
<tr id="rel">
<td>
<div class="abs"></div>
</td>
</tr>
</table>
</div>
</body>
</html>

View File

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 300px;
height: 300px;
background-color: blue;
}
td {
margin: 0;
padding: 0;
}
#rel {
position: relative;
margin: 0;
padding: 0;
}
#abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
</style>
</head>
<body>
The green square should not touch the blue square.
<table>
<tr>
<td></td>
<td></td>
</tr>
<tr style="height: 100%">
<td></td>
<td></td>
</tr>
<tr id="rel">
<td></td>
<td>
<div id="abs"></div>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 300px;
height: 300px;
background-color: blue;
}
td, div {
margin: 0;
padding: 0;
}
#rel {
position: relative;
margin: 0;
padding: 0;
}
#abs {
position: absolute;
margin: 0;
padding: 0;
top: 200px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
</style>
</head>
<body>
The green square should not touch the blue square.
<table>
<colgroup>
<col style="width: 15%">
<col>
</colgroup>
<tr>
<td></td>
<td></td>
</tr>
<tr id="rel">
<td></td>
<td>
<div id="abs"></div>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<style>
#rel {
position: relative;
margin: 0;
padding: 0;
}
.abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
#bad {
background-color: blue;
}
</style>
</head>
<body>
The green square should not completely cover the blue square.
<div class="abs" id="bad"></div>
<table>
<tbody id="rel">
<tr>
<td>
<div class="abs"></div>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<style>
#rel {
position: relative;
margin: 0;
padding: 0;
}
.abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
#bad {
background-color: blue;
}
</style>
</head>
<body>
The green square should not completely cover the blue square.
<div class="abs" id="bad"></div>
<div style="position: relative">
<table>
<tbody id="rel">
<tr>
<td>
<div class="abs"></div>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 300px;
height: 300px;
background-color: blue;
}
td {
margin: 0;
padding: 0;
}
#rel {
position: relative;
margin: 0;
padding: 0;
}
#abs {
position: absolute;
margin: 0;
padding: 0;
top: 25px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
</style>
</head>
<body>
The green square should not touch the blue square.
<table>
<thead>
<tr>
<td></td>
<td></td>
</tr>
<tr style="height: 100%">
<td></td>
<td></td>
</tr>
</thead>
<tbody id="rel">
<tr>
<td></td>
<td>
<div id="abs"></div>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 300px;
height: 300px;
background-color: blue;
}
td {
margin: 0;
padding: 0;
}
#rel {
position: relative;
margin: 0;
padding: 0;
}
#abs {
position: absolute;
margin: 0;
padding: 0;
top: 200px;
left: 25px;
width: 50px;
height: 50px;
background-color: green;
}
</style>
</head>
<body>
The green square should not touch the blue square.
<table>
<colgroup>
<col style="width: 15%">
<col>
</colgroup>
<thead>
<tr>
<td></td>
<td></td>
</tr>
</thead>
<tbody id="rel">
<tr>
<td></td>
<td>
<div id="abs"></div>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@ -87,6 +87,16 @@ nsTableCellFrame::Init(nsIContent* aContent,
}
}
void
nsTableCellFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
if (GetStateBits() & NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN) {
nsTableFrame::UnregisterPositionedTablePart(this, aDestructRoot);
}
nsContainerFrame::DestroyFrom(aDestructRoot);
}
// nsIPercentHeightObserver methods
void

View File

@ -47,6 +47,8 @@ public:
nsIFrame* aParent,
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
#ifdef ACCESSIBILITY
virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
#endif

View File

@ -41,6 +41,7 @@
#include "nsDisplayList.h"
#include "nsIScrollableFrame.h"
#include "nsCSSProps.h"
#include "RestyleTracker.h"
#include <algorithm>
using namespace mozilla;
@ -252,6 +253,64 @@ nsTableFrame::PageBreakAfter(nsIFrame* aSourceFrame,
return false;
}
typedef nsTArray<nsIFrame*> FrameTArray;
/* static */ void
nsTableFrame::DestroyPositionedTablePartArray(void* aPropertyValue)
{
auto positionedObjs = static_cast<FrameTArray*>(aPropertyValue);
delete positionedObjs;
}
/* static */ void
nsTableFrame::RegisterPositionedTablePart(nsIFrame* aFrame)
{
nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(aFrame);
MOZ_ASSERT(tableFrame, "Should have a table frame here");
tableFrame = static_cast<nsTableFrame*>(tableFrame->FirstContinuation());
// Retrieve the positioned parts array for this table.
FrameProperties props = tableFrame->Properties();
auto positionedParts =
static_cast<FrameTArray*>(props.Get(PositionedTablePartArray()));
// Lazily create the array if it doesn't exist yet.
if (!positionedParts) {
positionedParts = new FrameTArray;
props.Set(PositionedTablePartArray(), positionedParts);
}
// Add this frame to the list.
positionedParts->AppendElement(aFrame);
}
/* static */ void
nsTableFrame::UnregisterPositionedTablePart(nsIFrame* aFrame,
nsIFrame* aDestructRoot)
{
// Retrieve the table frame, and ensure that we hit aDestructRoot on the way.
// If we don't, that means that the table frame will be destroyed, so we don't
// need to bother with unregistering this frame.
nsTableFrame* tableFrame = GetTableFramePassingThrough(aDestructRoot, aFrame);
if (!tableFrame) {
return;
}
tableFrame = static_cast<nsTableFrame*>(tableFrame->FirstContinuation());
// Retrieve the positioned parts array for this table.
FrameProperties props = tableFrame->Properties();
auto positionedParts =
static_cast<FrameTArray*>(props.Get(PositionedTablePartArray()));
// Remove the frame.
MOZ_ASSERT(positionedParts &&
positionedParts->IndexOf(aFrame) != FrameTArray::NoIndex,
"Asked to unregister a positioned table part that wasn't registered");
if (positionedParts) {
positionedParts->RemoveElement(aFrame);
}
}
// XXX this needs to be cleaned up so that the frame constructor breaks out col group
// frames into a separate child list, bug 343048.
nsresult
@ -1814,6 +1873,10 @@ nsresult nsTableFrame::Reflow(nsPresContext* aPresContext,
AdjustForCollapsingRowsCols(aDesiredSize, borderPadding);
}
// If there are any relatively-positioned table parts, we need to reflow their
// absolutely-positioned descendants now that their dimensions are final.
FixupPositionedTableParts(aPresContext, aReflowState);
// make sure the table overflow area does include the table rect.
nsRect tableRect(0, 0, aDesiredSize.Width(), aDesiredSize.Height()) ;
@ -1834,6 +1897,57 @@ nsresult nsTableFrame::Reflow(nsPresContext* aPresContext,
return rv;
}
void
nsTableFrame::FixupPositionedTableParts(nsPresContext* aPresContext,
const nsHTMLReflowState& aReflowState)
{
auto positionedParts =
static_cast<FrameTArray*>(Properties().Get(PositionedTablePartArray()));
if (!positionedParts) {
return;
}
OverflowChangedTracker overflowTracker;
overflowTracker.SetSubtreeRoot(this);
for (size_t i = 0; i < positionedParts->Length(); ++i) {
nsIFrame* positionedPart = positionedParts->ElementAt(i);
// As we've already finished reflow, positionedParts's size and overflow
// areas have already been assigned, so we just pull them back out.
nsSize size(positionedPart->GetSize());
nsHTMLReflowMetrics desiredSize(aReflowState.GetWritingMode());
desiredSize.Width() = size.width;
desiredSize.Height() = size.height;
desiredSize.mOverflowAreas = positionedPart->GetOverflowAreasRelativeToSelf();
// Construct a dummy reflow state and reflow status.
// XXX(seth): Note that the dummy reflow state doesn't have a correct
// chain of parent reflow states. It also doesn't necessarily have a
// correct containing block.
nsHTMLReflowState reflowState(aPresContext, positionedPart,
aReflowState.rendContext,
nsSize(size.width, NS_UNCONSTRAINEDSIZE),
nsHTMLReflowState::DUMMY_PARENT_REFLOW_STATE);
nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
// Reflow absolutely-positioned descendants of the positioned part.
// FIXME: Unconditionally using NS_UNCONSTRAINEDSIZE for the height and
// ignoring any change to the reflow status aren't correct. We'll never
// paginate absolutely positioned frames.
overflowTracker.AddFrame(positionedPart);
nsFrame* positionedFrame = static_cast<nsFrame*>(positionedPart);
positionedFrame->FinishReflowWithAbsoluteFrames(PresContext(),
desiredSize,
reflowState,
reflowStatus,
true);
}
// Propagate updated overflow areas up the tree.
overflowTracker.Flush();
}
bool
nsTableFrame::UpdateOverflow()
{
@ -3444,6 +3558,31 @@ nsTableFrame::GetTableFrame(nsIFrame* aFrame)
return nullptr;
}
nsTableFrame*
nsTableFrame::GetTableFramePassingThrough(nsIFrame* aMustPassThrough,
nsIFrame* aFrame)
{
MOZ_ASSERT(aMustPassThrough == aFrame ||
nsLayoutUtils::IsProperAncestorFrame(aMustPassThrough, aFrame),
"aMustPassThrough should be an ancestor");
// Retrieve the table frame, and ensure that we hit aMustPassThrough on the
// way. If we don't, just return null.
nsTableFrame* tableFrame = nullptr;
for (nsIFrame* ancestor = aFrame; ancestor; ancestor = ancestor->GetParent()) {
if (nsGkAtoms::tableFrame == ancestor->GetType()) {
tableFrame = static_cast<nsTableFrame*>(ancestor);
break;
}
if (ancestor == aMustPassThrough) {
return nullptr;
}
}
MOZ_ASSERT(tableFrame, "Should have a table frame here");
return tableFrame;
}
bool
nsTableFrame::IsAutoHeight()
{

View File

@ -111,6 +111,9 @@ class nsTableFrame : public nsContainerFrame
public:
NS_DECL_FRAMEARENA_HELPERS
static void DestroyPositionedTablePartArray(void* aPropertyValue);
NS_DECLARE_FRAME_PROPERTY(PositionedTablePartArray, DestroyPositionedTablePartArray)
/** nsTableOuterFrame has intimate knowledge of the inner table frame */
friend class nsTableOuterFrame;
@ -147,6 +150,15 @@ public:
static bool PageBreakAfter(nsIFrame* aSourceFrame,
nsIFrame* aNextFrame);
// Register a positioned table part with its nsTableFrame. These objects will
// be visited by FixupPositionedTableParts after reflow is complete. (See that
// function for more explanation.) Should be called during frame construction.
static void RegisterPositionedTablePart(nsIFrame* aFrame);
// Unregister a positioned table part with its nsTableFrame.
static void UnregisterPositionedTablePart(nsIFrame* aFrame,
nsIFrame* aDestructRoot);
nsPoint GetFirstSectionOrigin(const nsHTMLReflowState& aReflowState) const;
/*
* Notification that aAttribute has changed for content inside a table (cell, row, etc)
@ -179,6 +191,12 @@ public:
/** helper method to find the table parent of any table frame object */
static nsTableFrame* GetTableFrame(nsIFrame* aSourceFrame);
/* Like GetTableFrame, but will return nullptr if we don't pass through
* aMustPassThrough on the way to the table.
*/
static nsTableFrame* GetTableFramePassingThrough(nsIFrame* aMustPassThrough,
nsIFrame* aSourceFrame);
typedef void (* DisplayGenericTablePartTraversal)
(nsDisplayListBuilder* aBuilder, nsFrame* aFrame,
const nsRect& aDirtyRect, const nsDisplayListSet& aLists);
@ -549,6 +567,18 @@ protected:
void AdjustForCollapsingRowsCols(nsHTMLReflowMetrics& aDesiredSize,
nsMargin aBorderPadding);
/** FixupPositionedTableParts is called at the end of table reflow to reflow
* the absolutely positioned descendants of positioned table parts. This is
* necessary because the dimensions of table parts may change after they've
* been reflowed (e.g. in AdjustForCollapsingRowsCols).
*/
void FixupPositionedTableParts(nsPresContext* aPresContext,
const nsHTMLReflowState& aReflowState);
// Clears the list of positioned table parts.
void ClearAllPositionedTableParts();
nsITableLayoutStrategy* LayoutStrategy() const {
return static_cast<nsTableFrame*>(FirstInFlow())->
mTableLayoutStrategy;

View File

@ -150,6 +150,16 @@ nsTableRowFrame::Init(nsIContent* aContent,
}
}
void
nsTableRowFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
if (GetStateBits() & NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN) {
nsTableFrame::UnregisterPositionedTablePart(this, aDestructRoot);
}
nsContainerFrame::DestroyFrom(aDestructRoot);
}
/* virtual */ void
nsTableRowFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
{

View File

@ -36,6 +36,9 @@ public:
virtual void Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
/** @see nsIFrame::DidSetStyleContext */
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) MOZ_OVERRIDE;

View File

@ -34,6 +34,16 @@ nsTableRowGroupFrame::~nsTableRowGroupFrame()
{
}
void
nsTableRowGroupFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
if (GetStateBits() & NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN) {
nsTableFrame::UnregisterPositionedTablePart(this, aDestructRoot);
}
nsContainerFrame::DestroyFrom(aDestructRoot);
}
NS_QUERYFRAME_HEAD(nsTableRowGroupFrame)
NS_QUERYFRAME_ENTRY(nsTableRowGroupFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)

View File

@ -67,6 +67,9 @@ public:
*/
friend nsIFrame* NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
virtual ~nsTableRowGroupFrame();
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
/** @see nsIFrame::DidSetStyleContext */
virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) MOZ_OVERRIDE;

View File

@ -17,29 +17,11 @@ STL_FLAGS =
include $(topsrcdir)/config/rules.mk
ifdef GNU_CXX
# Stagefright header files define many multichar constants.
CXXFLAGS += -Wno-multichar
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),gonk)
EXTRA_DSO_LDOPTS += \
-lutils -lstagefright -lmedia -lstagefright_omx -lbinder -lui \
-lhardware -lcutils \
$(NULL)
CXXFLAGS += \
-I$(ANDROID_SOURCE)/dalvik/libnativehelper/include/nativehelper \
-I$(ANDROID_SOURCE)/frameworks/base/include/ \
-I$(ANDROID_SOURCE)/frameworks/base/include/binder/ \
-I$(ANDROID_SOURCE)/frameworks/base/include/utils/ \
-I$(ANDROID_SOURCE)/frameworks/base/include/media/ \
-I$(ANDROID_SOURCE)/frameworks/base/include/media/stagefright/openmax \
-I$(ANDROID_SOURCE)/frameworks/base/media/libstagefright/include \
-I$(ANDROID_SOURCE)/frameworks/base/native/include \
-I$(ANDROID_SOURCE)/system/core/include \
-I$(ANDROID_SOURCE)/hardware/libhardware/include \
$(NULL)
else
EXTRA_DSO_LDOPTS += \
-L$(DEPTH)/media/omx-plugin/lib/ics/libutils \

View File

@ -33,3 +33,23 @@ else:
'include/ics',
'include/ics/media/stagefright/openmax',
]
if CONFIG['GNU_CXX']:
# Stagefright header files define many multichar constants.
CXXFLAGS += ['-Wno-multichar']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
CXXFLAGS += [
'-I%s/%s' % (CONFIG['ANDROID_SOURCE'], d) for d in [
'dalvik/libnativehelper/include/nativehelper',
'frameworks/base/include/',
'frameworks/base/include/binder/',
'frameworks/base/include/utils/',
'frameworks/base/include/media/',
'frameworks/base/include/media/stagefright/openmax',
'frameworks/base/media/libstagefright/include',
'frameworks/base/native/include',
'system/core/include',
'hardware/libhardware/include',
]
]

View File

@ -1,19 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include $(topsrcdir)/config/rules.mk
ifeq ($(ANDROID_VERSION),$(findstring $(ANDROID_VERSION),15))
CXXFLAGS += \
-I$(ANDROID_SOURCE)/frameworks/base/media/libstagefright/mpeg2ts \
$(NULL)
else
CXXFLAGS += \
-I$(ANDROID_SOURCE)/frameworks/av/media/libstagefright/mpeg2ts \
$(NULL)
endif
CXXFLAGS += \
-Wno-multichar \
$(NULL)

View File

@ -63,3 +63,10 @@ LOCAL_INCLUDES += [
for var in ('IMPL_NS_NET', 'FORCE_PR_LOG'):
DEFINES[var] = True
if CONFIG['ANDROID_VERSION'] == '15':
CXXFLAGS += ['-I%s/frameworks/base/media/libstagefright/mpeg2ts' % CONFIG['ANDROID_SOURCE']]
else:
CXXFLAGS += ['-I%s/frameworks/av/media/libstagefright/mpeg2ts' % CONFIG['ANDROID_SOURCE']]
CXXFLAGS += ['-Wno-multichar']

View File

@ -5,5 +5,5 @@
include $(topsrcdir)/config/rules.mk
CXXFLAGS += $(TK_CFLAGS) -DGOOGLE_PROTOBUF_NO_RTTI
CXXFLAGS += $(TK_CFLAGS)

Some files were not shown because too many files have changed in this diff Show More