Backed out changeset d7c237784ce9 (bug 886230) for B2G mochitest-9 failures in test_bug582181-1.html

This commit is contained in:
Ed Morley 2013-06-25 13:45:09 +01:00
parent 8f0987a904
commit de6da097d6
7 changed files with 12 additions and 100 deletions

View File

@ -3204,9 +3204,6 @@ CanvasRenderingContext2D::DrawWindow(nsIDOMWindow* window, double x,
if (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_ASYNC_DECODE_IMAGES) {
renderDocFlags |= nsIPresShell::RENDER_ASYNC_DECODE_IMAGES;
}
if (flags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DO_NOT_FLUSH) {
renderDocFlags |= nsIPresShell::RENDER_DRAWWINDOW_NOT_FLUSHING;
}
// gfxContext-over-Azure may modify the DrawTarget's transform, so
// save and restore it

View File

@ -80,7 +80,6 @@ MOCHITEST_FILES = \
switch-helper.svg \
test_text.html \
test_text_2.html \
test_text_dirty.html \
test_text_scaled.html \
test_text_selection.html \
test_text_update.html \

View File

@ -1,55 +0,0 @@
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=886230
-->
<head>
<title>Test for Bug 886230</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<style type="text/css">
</style>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=886230">Mozilla Bug 886230</a>
<p id="display">
<svg>
<mask id="m"><text id="t">x</text></mask>
<rect width="600" height="400" mask="url(#m)"/>
</svg>
</p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
function runTest() {
var svgText = document.getElementById("t");
// Recreate the frames for the <text> with the pref set.
svgText.style.display = "none";
svgText.getComputedTextLength();
svgText.style.display = "inline";
svgText.getComputedTextLength();
// Dirty the frames.
document.getElementById("display").style.width = "700px";
svgText.removeChild(svgText.firstChild);
// Paint without flushing layout. If the test fails, we'll trigger
// an assertion.
SpecialPowers.snapshotWindowWithOptions(window, undefined, undefined, { DRAWWINDOW_DO_NOT_FLUSH: true });
ok(true);
SimpleTest.finish();
}
window.addEventListener("load", function() {
SpecialPowers.pushPrefEnv({'set': [['svg.text.css-frames.enabled', true]]}, runTest);
}, false);
SimpleTest.waitForExplicitFinish();
</script>
</pre>
</body>
</html>

View File

@ -173,8 +173,7 @@ protected:
typedef mozilla::layers::LayerManager LayerManager;
enum eRenderFlag {
STATE_IGNORING_VIEWPORT_SCROLLING = 0x1,
STATE_DRAWWINDOW_NOT_FLUSHING = 0x2
STATE_IGNORING_VIEWPORT_SCROLLING = 0x1
};
typedef uint8_t RenderFlags; // for storing the above flags
@ -984,8 +983,7 @@ public:
RENDER_CARET = 0x04,
RENDER_USE_WIDGET_LAYERS = 0x08,
RENDER_ASYNC_DECODE_IMAGES = 0x10,
RENDER_DOCUMENT_RELATIVE = 0x20,
RENDER_DRAWWINDOW_NOT_FLUSHING = 0x40
RENDER_DOCUMENT_RELATIVE = 0x20
};
virtual NS_HIDDEN_(nsresult) RenderDocument(const nsRect& aRect, uint32_t aFlags,
nscolor aBackgroundColor,
@ -1222,13 +1220,6 @@ public:
float GetXResolution() { return mXResolution; }
float GetYResolution() { return mYResolution; }
/**
* Returns whether we are in a DrawWindow() call that used the
* DRAWWINDOW_DO_NOT_FLUSH flag.
*/
bool InDrawWindowNotFlushing() const
{ return mRenderFlags & STATE_DRAWWINDOW_NOT_FLUSHING; }
/**
* Set the isFirstPaint flag.
*/

View File

@ -4450,9 +4450,6 @@ PresShell::RenderDocument(const nsRect& aRect, uint32_t aFlags,
wouldFlushRetainedLayers = !IgnoringViewportScrolling();
mRenderFlags = ChangeFlag(mRenderFlags, true, STATE_IGNORING_VIEWPORT_SCROLLING);
}
if (aFlags & RENDER_DRAWWINDOW_NOT_FLUSHING) {
mRenderFlags = ChangeFlag(mRenderFlags, true, STATE_DRAWWINDOW_NOT_FLUSHING);
}
if (aFlags & RENDER_DOCUMENT_RELATIVE) {
// XXX be smarter about this ... drawWindow might want a rect
// that's "pretty close" to what our retained layer tree covers.

View File

@ -3356,22 +3356,12 @@ nsSVGTextFrame2::PaintSVG(nsRenderingContext* aContext,
if (!kid)
return NS_OK;
nsPresContext* presContext = PresContext();
gfxContext *gfx = aContext->ThebesContext();
gfxMatrix initialMatrix = gfx->CurrentMatrix();
AutoCanvasTMForMarker autoCanvasTMFor(this, FOR_PAINTING);
if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
// If we are in a canvas DrawWindow call that used the
// DRAWWINDOW_DO_NOT_FLUSH flag, then we may still have out
// of date frames. Just don't paint anything if they are
// dirty.
if (presContext->PresShell()->InDrawWindowNotFlushing() &&
NS_SUBTREE_DIRTY(this)) {
return NS_OK;
}
// Text frames inside <clipPath>, <mask>, etc. will never have had
// ReflowSVG called on them, so call UpdateGlyphPositioning to do this now.
UpdateGlyphPositioning();
@ -3391,6 +3381,8 @@ nsSVGTextFrame2::PaintSVG(nsRenderingContext* aContext,
gfxMatrix matrixForPaintServers(canvasTM);
matrixForPaintServers.Multiply(initialMatrix);
nsPresContext* presContext = PresContext();
// Check if we need to draw anything.
if (aDirtyRect) {
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||

View File

@ -1112,42 +1112,33 @@ SpecialPowersAPI.prototype = {
return this.wrap(Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest));
},
snapshotWindowWithOptions: function (win, rect, bgcolor, options) {
snapshotWindow: function (win, withCaret, rect, bgcolor) {
var el = this.window.get().document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
if (rect === undefined) {
if (arguments.length < 3) {
rect = { top: win.scrollY, left: win.scrollX,
width: win.innerWidth, height: win.innerHeight };
}
if (bgcolor === undefined) {
if (arguments.length < 4) {
bgcolor = "rgb(255,255,255)";
}
if (options === undefined) {
options = { };
}
el.width = rect.width;
el.height = rect.height;
var ctx = el.getContext("2d");
var flags = 0;
for (var option in options) {
flags |= ctx[option];
}
ctx.drawWindow(win,
rect.left, rect.top, rect.width, rect.height,
bgcolor,
flags);
withCaret ? ctx.DRAWWINDOW_DRAW_CARET : 0);
return el;
},
snapshotWindow: function (win, withCaret, rect, bgcolor) {
return this.snapshotWindowWithOptions(win, rect, bgcolor,
{ DRAWWINDOW_DRAW_CARET: withCaret });
},
snapshotRect: function (win, rect, bgcolor) {
return this.snapshotWindow(win, false, rect, bgcolor);
// Splice in our "do not want caret" bit
args = Array.slice(arguments);
args.splice(1, 0, false);
return this.snapshotWindow.apply(this, args);
},
gc: function() {