Bug 687972 - backing out changesets b17ab862bbc1 and a6db0c6c94a3 r=orange

This commit is contained in:
Brad Lassey 2011-11-30 22:59:00 -05:00
Родитель a6e6f0fc48
Коммит 7ebe9cd16d
17 изменённых файлов: 83 добавлений и 377 удалений

Просмотреть файл

@ -141,7 +141,7 @@ interface nsIContentViewManager : nsISupports
readonly attribute nsIContentView rootContentView;
};
[scriptable, uuid(efc0b731-45dc-4189-8ffa-d3eeeb850977)]
[scriptable, uuid(12905a29-4246-475a-81d4-fc389197df02)]
interface nsIFrameLoader : nsISupports
{
/**
@ -258,13 +258,6 @@ interface nsIFrameLoader : nsISupports
const unsigned long EVENT_MODE_DONT_FORWARD_TO_CHILD = 0x00000001;
attribute unsigned long eventMode;
/**
* If false, then the subdocument is not clipped to its CSS viewport, and the
* subdocument's viewport scrollbar(s) are not rendered.
* Defaults to true.
*/
attribute boolean clipSubdocument;
};
native alreadyAddRefed_nsFrameLoader(already_AddRefed<nsFrameLoader>);

Просмотреть файл

@ -143,12 +143,14 @@ public:
nsRefPtr<nsIDocShell> mDocShell;
};
static void InvalidateFrame(nsIFrame* aFrame, PRUint32 aFlags)
static void InvalidateFrame(nsIFrame* aFrame)
{
if (!aFrame)
return;
nsRect rect = nsRect(nsPoint(0, 0), aFrame->GetRect().Size());
aFrame->InvalidateWithFlags(rect, aFlags);
// NB: we pass INVALIDATE_NO_THEBES_LAYERS here to keep view
// semantics the same for both in-process and out-of-process
// <browser>. This is just a transform of the layer subtree in
// both.
aFrame->InvalidateWithFlags(rect, nsIFrame::INVALIDATE_NO_THEBES_LAYERS);
}
NS_IMPL_ISUPPORTS1(nsContentView, nsIContentView)
@ -187,11 +189,8 @@ nsContentView::Update(const ViewConfig& aConfig)
// XXX could be clever here and compute a smaller invalidation
// rect
// NB: we pass INVALIDATE_NO_THEBES_LAYERS here to keep view
// semantics the same for both in-process and out-of-process
// <browser>. This is just a transform of the layer subtree in
// both.
InvalidateFrame(mFrameLoader->GetPrimaryFrameOfOwningContent(), nsIFrame::INVALIDATE_NO_THEBES_LAYERS);
nsIFrame* frame = mFrameLoader->GetPrimaryFrameOfOwningContent();
InvalidateFrame(frame);
return NS_OK;
}
@ -329,7 +328,6 @@ nsFrameLoader::nsFrameLoader(Element* aOwner, bool aNetworkCreated)
, mDelayRemoteDialogs(false)
, mRemoteBrowserShown(false)
, mRemoteFrame(false)
, mClipSubdocument(true)
, mCurrentRemoteFrame(nsnull)
, mRemoteBrowser(nsnull)
, mRenderMode(RENDER_MODE_DEFAULT)
@ -1695,11 +1693,7 @@ nsFrameLoader::SetRenderMode(PRUint32 aRenderMode)
}
mRenderMode = aRenderMode;
// NB: we pass INVALIDATE_NO_THEBES_LAYERS here to keep view
// semantics the same for both in-process and out-of-process
// <browser>. This is just a transform of the layer subtree in
// both.
InvalidateFrame(GetPrimaryFrameOfOwningContent(), nsIFrame::INVALIDATE_NO_THEBES_LAYERS);
InvalidateFrame(GetPrimaryFrameOfOwningContent());
return NS_OK;
}
@ -1717,38 +1711,6 @@ nsFrameLoader::SetEventMode(PRUint32 aEventMode)
return NS_OK;
}
NS_IMETHODIMP
nsFrameLoader::GetClipSubdocument(bool* aResult)
{
*aResult = mClipSubdocument;
return NS_OK;
}
NS_IMETHODIMP
nsFrameLoader::SetClipSubdocument(bool aClip)
{
mClipSubdocument = aClip;
nsIFrame* frame = GetPrimaryFrameOfOwningContent();
if (frame) {
InvalidateFrame(frame, 0);
frame->PresContext()->PresShell()->
FrameNeedsReflow(frame, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
nsSubDocumentFrame* subdocFrame = do_QueryFrame(frame);
if (subdocFrame) {
nsIFrame* subdocRootFrame = subdocFrame->GetSubdocumentRootFrame();
if (subdocRootFrame) {
nsIFrame* subdocRootScrollFrame = subdocRootFrame->PresContext()->PresShell()->
GetRootScrollFrame();
if (subdocRootScrollFrame) {
frame->PresContext()->PresShell()->
FrameNeedsReflow(frame, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
}
}
}
}
return NS_OK;
}
nsIntSize
nsFrameLoader::GetSubDocumentSize(const nsIFrame *aIFrame)
{

Просмотреть файл

@ -287,8 +287,6 @@ public:
mozilla::dom::Element* GetOwnerContent() { return mOwnerContent; }
void SetOwnerContent(mozilla::dom::Element* aContent);
bool ShouldClipSubdocument() { return mClipSubdocument; }
private:
bool ShouldUseRemoteProcess();
@ -340,9 +338,7 @@ private:
bool mDelayRemoteDialogs : 1;
bool mRemoteBrowserShown : 1;
bool mRemoteFrame : 1;
bool mClipSubdocument : 1;
bool mRemoteFrame;
// XXX leaking
nsCOMPtr<nsIObserver> mChildHost;
RenderFrameParent* mCurrentRemoteFrame;

Просмотреть файл

@ -644,7 +644,9 @@ void nsBuiltinDecoder::NotifySuspendedStatusChanged()
NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
if (!mStream)
return;
if (mStream->IsSuspendedByCache() && mElement) {
bool suspended = mStream->IsSuspendedByCache();
printf("*** nsBuiltinDecoder::NotifySuspendedStatusChanged(%p), suspended=%d\n", this, suspended);
if (suspended && mElement) {
// if this is an autoplay element, we need to kick off its autoplaying
// now so we consume data and hopefully free up cache space
mElement->NotifyAutoplayDataReady();

Просмотреть файл

@ -46,6 +46,13 @@ function ended(e) {
500);
}
var eventsToLog = ["play", "canplay", "canplaythrough", "loadstart", "loadedmetadata",
"loadeddata", "playing", "progress", "timeupdate", "ended", "suspend", "error", "stalled", "emptied", "abort",
"waiting", "pause"];
function logEvent(event) {
ok(true, event.target.currentSrc + " got " + event.type);
}
function startTest(test, token) {
var type = /^video/.test(test.type) ? "video" : "audio";
var v = document.createElement(type);
@ -59,6 +66,9 @@ function startTest(test, token) {
v.autoplay = true;
v.addEventListener("ended", ended, false);
v.addEventListener("timeupdate", timeupdate, false);
for (var i = 0; i < eventsToLog.length; ++i) {
v.addEventListener(eventsToLog[i], logEvent, false);
}
document.body.appendChild(v);
}

Просмотреть файл

@ -7295,14 +7295,14 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
desiredSize.height == size.height),
"non-root frame's desired size changed during an "
"incremental reflow");
NS_ASSERTION(target == rootFrame || desiredSize.VisualOverflow().IsEqualInterior(
NS_ASSERTION(desiredSize.VisualOverflow().IsEqualInterior(
nsRect(nsPoint(0, 0),
nsSize(desiredSize.width, desiredSize.height))),
"non-root reflow roots must not have visible overflow");
NS_ASSERTION(target == rootFrame || desiredSize.ScrollableOverflow().IsEqualEdges(
"reflow roots must not have visible overflow");
NS_ASSERTION(desiredSize.ScrollableOverflow().IsEqualEdges(
nsRect(nsPoint(0, 0),
nsSize(desiredSize.width, desiredSize.height))),
"non-root reflow roots must not have scrollable overflow");
"reflow roots must not have scrollable overflow");
NS_ASSERTION(status == NS_FRAME_COMPLETE,
"reflow roots should never split");

Просмотреть файл

@ -62,9 +62,6 @@ _CHROME_FILES = \
test_default_background.xul \
default_background_window.xul \
test_leaf_layers_partition_browser_window.xul \
test_no_clip_iframe.xul \
no_clip_iframe_window.xul \
no_clip_iframe_subdoc.html \
test_printpreview.xul \
printpreview_helper.xul \
test_printpreview_bug396024.xul \

Просмотреть файл

@ -1,7 +0,0 @@
<!DOCTYPE HTML>
<html>
<body style="margin:0; background:lime;">
<div id="d" style="position:relative; top:-50px; width:150px; height:250px; background:yellow;"></div>
<div id="p" style="margin-top:-50px; width:150px; height:50px;"></div>
</body>
</html>

Просмотреть файл

@ -1,137 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="runTests()">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript"
src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
<div id="container" xmlns="http://www.w3.org/1999/xhtml" style="height:400px; overflow:auto; background:gray">
<div style="height:0">
<iframe type="content" id="f" src="no_clip_iframe_subdoc.html"
style="margin-top:50px; border:1px solid black; width:100px; height:100px;"/>
</div>
<div id="ref" style="background:gray;">
<div style="border:1px solid black; margin-top:50px; width:100px; height:100px;">
<div id="ref-d" style="background:lime; height:250px; width:150px;">
<div style="position:relative; top:-50px; width:150px; height:100%; background:yellow;"/>
</div>
</div>
</div>
</div>
<vbox flex="1"/>
<script type="application/javascript">
<![CDATA[
var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ];
for each (var name in imports) {
window[name] = window.opener.wrappedJSObject[name];
}
SimpleTest.waitForExplicitFinish();
var accumulatedRect = null;
var onpaint = function() {};
function paintListener(event) {
if (event.target != window)
return;
dump("got MozAfterPaint: " + event.boundingClientRect.left + "," + event.boundingClientRect.top + "," +
event.boundingClientRect.right + "," + event.boundingClientRect.bottom + "\n");
if (accumulatedRect) {
accumulatedRect[0] = Math.min(accumulatedRect[0], event.boundingClientRect.left);
accumulatedRect[1] = Math.min(accumulatedRect[1], event.boundingClientRect.top);
accumulatedRect[2] = Math.max(accumulatedRect[2], event.boundingClientRect.right);
accumulatedRect[3] = Math.max(accumulatedRect[3], event.boundingClientRect.bottom);
} else {
accumulatedRect = [event.boundingClientRect.left, event.boundingClientRect.top,
event.boundingClientRect.right, event.boundingClientRect.bottom];
}
onpaint();
}
window.addEventListener("MozAfterPaint", paintListener, false);
function waitForAllPaintsFlushed(callback) {
document.documentElement.getBoundingClientRect();
var CI = Components.interfaces;
var utils = window.QueryInterface(CI.nsIInterfaceRequestor)
.getInterface(CI.nsIDOMWindowUtils);
if (!utils.isMozAfterPaintPending) {
dump("done...\n");
var result = accumulatedRect;
accumulatedRect = null;
onpaint = function() {};
if (!result) {
result = [0,0,0,0];
}
callback(result[0], result[1], result[2], result[3]);
return;
}
dump("waiting for paint...\n");
onpaint = function() { waitForAllPaintsFlushed(callback); };
}
var Ci = Components.interfaces;
var frame = document.getElementById("f");
var fl = frame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
is(fl.clipSubdocument, true, "clipSubdocument should default to true");
fl.clipSubdocument = false;
is(fl.clipSubdocument, false, "clipSubdocument should have been set to false");
function runTests() {
var ref = document.getElementById("ref");
frame.contentWindow.scrollTo(0,0);
ref.style.visibility = "hidden";
var testCanvas = snapshotWindow(window);
ref.style.visibility = "";
var refCanvas = snapshotWindow(window);
var comparison = compareSnapshots(testCanvas, refCanvas, true);
ok(comparison[0], "Basic overflow drawing; got " + comparison[1] + ", expected " + comparison[2]);
document.getElementById("container").style.height = "200px";
ref.style.visibility = "hidden";
testCanvas = snapshotWindow(window);
ref.style.visibility = "";
refCanvas = snapshotWindow(window);
comparison = compareSnapshots(testCanvas, refCanvas, true);
ok(comparison[0], "Drawing with vertical scrollbar to show overflow area computation; got " +
comparison[1] + ", expected " + comparison[2]);
frame.contentDocument.getElementById("d").style.height = "350px";
document.getElementById("ref-d").style.height = "350px";
ref.style.visibility = "hidden";
testCanvas = snapshotWindow(window);
ref.style.visibility = "";
refCanvas = snapshotWindow(window);
comparison = compareSnapshots(testCanvas, refCanvas, true);
ok(comparison[0], "testing dynamic overflow area change affecting scrollbar; got " +
comparison[1] + ", expected " + comparison[2]);
// Now do invalidation tests
ref.style.visibility = "hidden";
document.getElementById("container").style.height = "400px";
waitForAllPaintsFlushed(function() {
dump("Scrolling\n");
frame.contentWindow.scrollTo(0,80);
waitForAllPaintsFlushed(function(x1, y1, x2, y2) {
ok(x1 <= 1 && x2 >= 151 && y1 <= 0 && y2 >= 400,
"Entire scrolled region is painted: " + x1 + "," + y1 + "," + x2 + "," + y2);
frame.contentDocument.getElementById("p").style.background = "cyan";
waitForAllPaintsFlushed(function(x1, y1, x2, y2) {
ok(x1 <= 1 && x2 >= 151 && y1 <= 271 && y2 >= 320,
"Entire updated region is painted: " + x1 + "," + y1 + "," + x2 + "," + y2);
var tester = window.SimpleTest;
window.close();
tester.finish();
});
});
});
}
]]>
</script>
</window>

Просмотреть файл

@ -1,23 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml">
</body>
<!-- test code goes here -->
<script type="application/javascript">
<![CDATA[
SimpleTest.waitForExplicitFinish();
// Run the test in a separate window so that the test runs as a chrome
// window
window.open("no_clip_iframe_window.xul", "no_clip_iframe",
"chrome,width=200,height=400");
]]>
</script>
</window>

Просмотреть файл

@ -6439,17 +6439,13 @@ nsFrame::CreateAccessible()
NS_DECLARE_FRAME_PROPERTY(OverflowAreasProperty,
nsIFrame::DestroyOverflowAreas)
bool
void
nsIFrame::ClearOverflowRects()
{
if (mOverflow.mType == NS_FRAME_OVERFLOW_NONE) {
return false;
}
if (mOverflow.mType == NS_FRAME_OVERFLOW_LARGE) {
Properties().Delete(OverflowAreasProperty());
}
mOverflow.mType = NS_FRAME_OVERFLOW_NONE;
return true;
}
/** Create or retrieve the previously stored overflow area, if the frame does
@ -6477,18 +6473,17 @@ nsIFrame::GetOverflowAreasProperty()
/** Set the overflowArea rect, storing it as deltas or a separate rect
* depending on its size in relation to the primary frame rect.
*/
bool
void
nsIFrame::SetOverflowAreas(const nsOverflowAreas& aOverflowAreas)
{
if (mOverflow.mType == NS_FRAME_OVERFLOW_LARGE) {
nsOverflowAreas *overflow =
static_cast<nsOverflowAreas*>(Properties().Get(OverflowAreasProperty()));
bool changed = *overflow != aOverflowAreas;
*overflow = aOverflowAreas;
// Don't bother with converting to the deltas form if we already
// have a property.
return changed;
return;
}
const nsRect& vis = aOverflowAreas.VisualOverflow();
@ -6510,7 +6505,6 @@ nsIFrame::SetOverflowAreas(const nsOverflowAreas& aOverflowAreas)
// so that our eventual SetRect/SetSize will know that it has to
// reset our overflow areas.
(l | t | r | b) != 0) {
VisualDeltas oldDeltas = mOverflow.mVisualDeltas;
// It's a "small" overflow area so we store the deltas for each edge
// directly in the frame, rather than allocating a separate rect.
// If they're all zero, that's fine; we're setting things to
@ -6519,18 +6513,12 @@ nsIFrame::SetOverflowAreas(const nsOverflowAreas& aOverflowAreas)
mOverflow.mVisualDeltas.mTop = t;
mOverflow.mVisualDeltas.mRight = r;
mOverflow.mVisualDeltas.mBottom = b;
// There was no scrollable overflow before, and there isn't now.
return oldDeltas != mOverflow.mVisualDeltas;
} else {
bool changed = !aOverflowAreas.ScrollableOverflow().IsEqualEdges(nsRect(nsPoint(0, 0), GetSize())) ||
!aOverflowAreas.VisualOverflow().IsEqualEdges(GetVisualOverflowFromDeltas());
// it's a large overflow area that we need to store as a property
mOverflow.mType = NS_FRAME_OVERFLOW_LARGE;
nsOverflowAreas* overflow = GetOverflowAreasProperty();
NS_ASSERTION(overflow, "should have created areas");
*overflow = aOverflowAreas;
return changed;
}
}
@ -6541,7 +6529,7 @@ IsInlineFrame(nsIFrame *aFrame)
return type == nsGkAtoms::inlineFrame;
}
bool
void
nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
nsSize aNewSize)
{
@ -6650,11 +6638,11 @@ nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
bool visualOverflowChanged =
!GetVisualOverflowRect().IsEqualInterior(aOverflowAreas.VisualOverflow());
bool anyOverflowChanged;
if (aOverflowAreas != nsOverflowAreas(bounds, bounds)) {
anyOverflowChanged = SetOverflowAreas(aOverflowAreas);
SetOverflowAreas(aOverflowAreas);
} else {
anyOverflowChanged = ClearOverflowRects();
ClearOverflowRects();
}
if (visualOverflowChanged) {
@ -6699,8 +6687,6 @@ nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
nsDisplayItem::TYPE_TRANSFORM);
}
}
return anyOverflowChanged;
}
/* The overflow rects for leaf nodes in a preserve-3d hierarchy depends on

Просмотреть файл

@ -82,7 +82,6 @@
#include "mozilla/dom/Element.h"
#include "FrameLayerBuilder.h"
#include "nsSMILKeySpline.h"
#include "nsSubDocumentFrame.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -197,20 +196,16 @@ nsHTMLScrollFrame::InvalidateInternal(const nsRect& aDamageRect,
nsRect damage = aDamageRect + nsPoint(aX, aY);
// This is the damage rect that we're going to pass up to our parent.
nsRect parentDamage;
if (mInner.IsIgnoringViewportClipping()) {
parentDamage = damage;
// If we're using a displayport, we might be displaying an area
// different than our scroll port and the damage needs to be
// clipped to that instead.
nsRect displayport;
bool usingDisplayport = nsLayoutUtils::GetDisplayPort(GetContent(),
&displayport);
if (usingDisplayport) {
parentDamage.IntersectRect(damage, displayport);
} else {
// If we're using a displayport, we might be displaying an area
// different than our scroll port and the damage needs to be
// clipped to that instead.
nsRect displayport;
bool usingDisplayport = nsLayoutUtils::GetDisplayPort(GetContent(),
&displayport);
if (usingDisplayport) {
parentDamage.IntersectRect(damage, displayport);
} else {
parentDamage.IntersectRect(damage, mInner.mScrollPort);
}
parentDamage.IntersectRect(damage, mInner.mScrollPort);
}
if (IsScrollingActive()) {
@ -288,7 +283,7 @@ struct ScrollReflowState {
nsMargin mComputedBorder;
// === Filled in by ReflowScrolledFrame ===
nsOverflowAreas mContentsOverflowAreas;
nsRect mContentsOverflowArea;
bool mReflowedContentsWithHScrollbar;
bool mReflowedContentsWithVScrollbar;
@ -432,8 +427,7 @@ nsHTMLScrollFrame::TryLayout(ScrollReflowState* aState,
if (!aForce) {
nsRect scrolledRect =
mInner.GetScrolledRectInternal(aState->mContentsOverflowAreas.ScrollableOverflow(),
scrollPortSize);
mInner.GetScrolledRectInternal(aState->mContentsOverflowArea, scrollPortSize);
nscoord oneDevPixel = aState->mBoxState.PresContext()->DevPixelsToAppUnits(1);
// If the style is HIDDEN then we already know that aAssumeHScroll is false
@ -572,7 +566,7 @@ nsHTMLScrollFrame::ReflowScrolledFrame(ScrollReflowState* aState,
// overflow area doesn't include the frame bounds.
aMetrics->UnionOverflowAreasWithDesiredBounds();
aState->mContentsOverflowAreas = aMetrics->mOverflowAreas;
aState->mContentsOverflowArea = aMetrics->ScrollableOverflow();
aState->mReflowedContentsWithHScrollbar = aAssumeHScroll;
aState->mReflowedContentsWithVScrollbar = aAssumeVScroll;
@ -724,9 +718,7 @@ nsHTMLScrollFrame::PlaceScrollArea(const ScrollReflowState& aState,
nsRect scrolledArea;
// Preserve the width or height of empty rects
nsSize portSize = mInner.mScrollPort.Size();
nsRect scrolledRect =
mInner.GetScrolledRectInternal(aState.mContentsOverflowAreas.ScrollableOverflow(),
portSize);
nsRect scrolledRect = mInner.GetScrolledRectInternal(aState.mContentsOverflowArea, portSize);
scrolledArea.UnionRectEdges(scrolledRect,
nsRect(nsPoint(0,0), portSize));
@ -933,10 +925,6 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
state.mComputedBorder.TopBottom();
aDesiredSize.SetOverflowAreasToDesiredBounds();
if (mInner.IsIgnoringViewportClipping()) {
aDesiredSize.mOverflowAreas.UnionWith(
state.mContentsOverflowAreas + mInner.mScrolledFrame->GetPosition());
}
CheckInvalidateSizeChange(aDesiredSize);
@ -1699,15 +1687,6 @@ InvalidateFixedBackgroundFrames(nsIFrame* aRootFrame,
list.DeleteAll();
}
bool nsGfxScrollFrameInner::IsIgnoringViewportClipping() const
{
if (!mIsRoot)
return false;
nsSubDocumentFrame* subdocFrame = static_cast<nsSubDocumentFrame*>
(nsLayoutUtils::GetCrossDocParentFrame(mOuter->PresContext()->PresShell()->GetRootFrame()));
return subdocFrame && !subdocFrame->ShouldClipSubdocument();
}
bool nsGfxScrollFrameInner::IsAlwaysActive() const
{
// The root scrollframe for a non-chrome document which is the direct
@ -1742,7 +1721,7 @@ void nsGfxScrollFrameInner::MarkActive()
}
}
void nsGfxScrollFrameInner::ScrollVisual(nsPoint aOldScrolledFramePos)
void nsGfxScrollFrameInner::ScrollVisual()
{
nsRootPresContext* rootPresContext = mOuter->PresContext()->GetRootPresContext();
if (!rootPresContext) {
@ -1769,15 +1748,9 @@ void nsGfxScrollFrameInner::ScrollVisual(nsPoint aOldScrolledFramePos)
}
nsRect invalidateRect, displayport;
if (IsIgnoringViewportClipping()) {
nsRect visualOverflow = mScrolledFrame->GetVisualOverflowRect();
invalidateRect.UnionRect(visualOverflow + mScrolledFrame->GetPosition(),
visualOverflow + aOldScrolledFramePos);
} else {
invalidateRect =
(nsLayoutUtils::GetDisplayPort(mOuter->GetContent(), &displayport)) ?
displayport : mScrollPort;
}
invalidateRect =
(nsLayoutUtils::GetDisplayPort(mOuter->GetContent(), &displayport)) ?
displayport : mScrollPort;
mOuter->InvalidateWithFlags(invalidateRect, flags);
@ -1848,12 +1821,11 @@ nsGfxScrollFrameInner::ScrollToImpl(nsPoint aPt)
mListeners[i]->ScrollPositionWillChange(pt.x, pt.y);
}
nsPoint oldScrollFramePos = mScrolledFrame->GetPosition();
// Update frame position for scrolling
mScrolledFrame->SetPosition(mScrollPort.TopLeft() - pt);
// We pass in the amount to move visually
ScrollVisual(oldScrollFramePos);
ScrollVisual();
presContext->PresShell()->SynthesizeMouseMove(true);
UpdateScrollbarPosition();
@ -1965,7 +1937,7 @@ nsGfxScrollFrameInner::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
}
if (aBuilder->GetIgnoreScrollFrame() == mOuter || IsIgnoringViewportClipping()) {
if (aBuilder->GetIgnoreScrollFrame() == mOuter) {
// Don't clip the scrolled child, and don't paint scrollbars/scrollcorner.
// The scrolled frame shouldn't have its own background/border, so we
// can just pass aLists directly.

Просмотреть файл

@ -182,7 +182,7 @@ public:
static void AsyncScrollCallback(nsITimer *aTimer, void* anInstance);
void ScrollTo(nsPoint aScrollPosition, nsIScrollableFrame::ScrollMode aMode);
void ScrollToImpl(nsPoint aScrollPosition);
void ScrollVisual(nsPoint aOldScrolledFramePosition);
void ScrollVisual();
void ScrollBy(nsIntPoint aDelta, nsIScrollableFrame::ScrollUnit aUnit,
nsIScrollableFrame::ScrollMode aMode, nsIntPoint* aOverflow);
void ScrollToRestoredPosition();
@ -256,8 +256,6 @@ public:
const nsRect& aContentArea,
const nsRect& aOldScrollArea);
bool IsIgnoringViewportClipping() const;
bool IsAlwaysActive() const;
void MarkActive();
void MarkInactive();

Просмотреть файл

@ -2274,15 +2274,14 @@ public:
/**
* Store the overflow area in the frame's mOverflow.mVisualDeltas
* fields or as a frame property in the frame manager so that it can
* be retrieved later without reflowing the frame. Returns true if either of
* the overflow areas changed.
* be retrieved later without reflowing the frame.
*/
bool FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
void FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
nsSize aNewSize);
bool FinishAndStoreOverflow(nsHTMLReflowMetrics* aMetrics) {
return FinishAndStoreOverflow(aMetrics->mOverflowAreas,
nsSize(aMetrics->width, aMetrics->height));
void FinishAndStoreOverflow(nsHTMLReflowMetrics* aMetrics) {
FinishAndStoreOverflow(aMetrics->mOverflowAreas,
nsSize(aMetrics->width, aMetrics->height));
}
/**
@ -2295,9 +2294,8 @@ public:
/**
* Removes any stored overflow rects (visual and scrollable) from the frame.
* Returns true if the overflow changed.
*/
bool ClearOverflowRects();
void ClearOverflowRects();
/**
* Determine whether borders should not be painted on certain sides of the
@ -2824,24 +2822,14 @@ protected:
// If mOverflow.mType == NS_FRAME_OVERFLOW_LARGE, then the
// delta values are not meaningful and the overflow area is stored
// as a separate rect property.
struct VisualDeltas {
PRUint8 mLeft;
PRUint8 mTop;
PRUint8 mRight;
PRUint8 mBottom;
bool operator==(const VisualDeltas& aOther) const
{
return mLeft == aOther.mLeft && mTop == aOther.mTop &&
mRight == aOther.mRight && mBottom == aOther.mBottom;
}
bool operator!=(const VisualDeltas& aOther) const
{
return !(*this == aOther);
}
};
union {
PRUint32 mType;
VisualDeltas mVisualDeltas;
PRUint32 mType;
struct {
PRUint8 mLeft;
PRUint8 mTop;
PRUint8 mRight;
PRUint8 mBottom;
} mVisualDeltas;
} mOverflow;
// Helpers
@ -2956,10 +2944,7 @@ private:
mRect.height + mOverflow.mVisualDeltas.mBottom +
mOverflow.mVisualDeltas.mTop);
}
/**
* Returns true if any overflow changed.
*/
bool SetOverflowAreas(const nsOverflowAreas& aOverflowAreas);
void SetOverflowAreas(const nsOverflowAreas& aOverflowAreas);
nsPoint GetOffsetToCrossDoc(const nsIFrame* aOther, const PRInt32 aAPD) const;
#ifdef NS_DEBUG

Просмотреть файл

@ -411,21 +411,18 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
childItems.AppendToTop(layerItem);
}
if (ShouldClipSubdocument()) {
nsDisplayClip* item =
nsDisplayList list;
// Clip children to the child root frame's rectangle
rv = list.AppendNewToTop(
new (aBuilder) nsDisplayClip(aBuilder, this, &childItems,
subdocBoundsInParentUnits);
// Clip children to the child root frame's rectangle
childItems.AppendToTop(item);
}
subdocBoundsInParentUnits));
if (mIsInline) {
WrapReplacedContentForBorderRadius(aBuilder, &childItems, aLists);
WrapReplacedContentForBorderRadius(aBuilder, &list, aLists);
} else {
aLists.Content()->AppendToTop(&childItems);
aLists.Content()->AppendToTop(&list);
}
}
// delete childItems in case of OOM
childItems.DeleteAll();
@ -620,14 +617,6 @@ nsSubDocumentFrame::Reflow(nsPresContext* aPresContext,
vm->ResizeView(mInnerView, nsRect(nsPoint(0, 0), innerSize), true);
}
aDesiredSize.SetOverflowAreasToDesiredBounds();
if (!ShouldClipSubdocument()) {
nsIFrame* subdocRootFrame = GetSubdocumentRootFrame();
if (subdocRootFrame) {
aDesiredSize.mOverflowAreas.UnionWith(subdocRootFrame->GetOverflowAreas() + offset);
}
}
// Determine if we need to repaint our border, background or outline
CheckInvalidateSizeChange(aDesiredSize);

Просмотреть файл

@ -124,12 +124,6 @@ public:
virtual bool ReflowFinished();
virtual void ReflowCallbackCanceled();
bool ShouldClipSubdocument()
{
nsFrameLoader* frameLoader = FrameLoader();
return !frameLoader || frameLoader->ShouldClipSubdocument();
}
protected:
friend class AsyncFrameInit;

Просмотреть файл

@ -47,7 +47,6 @@
#include "nsIScrollableFrame.h"
#include "nsDisplayList.h"
#include "FrameLayerBuilder.h"
#include "nsSubDocumentFrame.h"
#include "nsAbsoluteContainingBlock.h"
using namespace mozilla;
@ -211,8 +210,6 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
nsresult rv = NS_OK;
aDesiredSize.SetOverflowAreasToDesiredBounds();
if (mFrames.NotEmpty()) {
// Deal with a non-incremental reflow or an incremental reflow
// targeted at our one-and-only principal child frame.
@ -237,7 +234,6 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
} else {
kidHeight = mFrames.FirstChild()->GetSize().height;
}
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, mFrames.FirstChild());
}
NS_ASSERTION(aReflowState.availableWidth != NS_UNCONSTRAINEDSIZE,
@ -256,18 +252,22 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
nsHTMLReflowState reflowState(aReflowState);
nsPoint offset = AdjustReflowStateForScrollbars(&reflowState);
#ifdef DEBUG
if (IsAbsoluteContainer()) {
NS_ASSERTION(GetAbsoluteContainingBlock()->GetChildList().IsEmpty() ||
(offset.x == 0 && offset.y == 0),
"We don't handle correct positioning of fixed frames with "
"scrollbars in odd positions");
}
#endif
if (IsAbsoluteContainer()) {
// Just reflow all the fixed-pos frames.
rv = GetAbsoluteContainingBlock()->Reflow(this, aPresContext, reflowState, aStatus,
reflowState.ComputedWidth(),
reflowState.ComputedHeight(),
false, true, true, // XXX could be optimized
&aDesiredSize.mOverflowAreas);
nsnull /* ignore overflow */);
}
// If we were dirty then do a repaint
@ -276,19 +276,8 @@ ViewportFrame::Reflow(nsPresContext* aPresContext,
Invalidate(damageRect);
}
// Clipping is handled by the document container (e.g., nsSubDocumentFrame),
// so we don't need to change our overflow areas.
bool overflowChanged = FinishAndStoreOverflow(&aDesiredSize);
if (overflowChanged) {
// We may need to alert our container to get it to pick up the
// overflow change.
nsSubDocumentFrame* container = static_cast<nsSubDocumentFrame*>
(nsLayoutUtils::GetCrossDocParentFrame(this));
if (container && !container->ShouldClipSubdocument()) {
container->PresContext()->PresShell()->
FrameNeedsReflow(container, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
}
}
// XXX Should we do something to clip our children to this?
aDesiredSize.SetOverflowAreasToDesiredBounds();
NS_FRAME_TRACE_REFLOW_OUT("ViewportFrame::Reflow", aStatus);
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);