mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Backed out changeset eaf182f23c3a (bug 847890) for failures in test_bug847890_paintFlashing.html on a CLOSED TREE
This commit is contained in:
parent
06098d79e9
commit
5fb0293004
@ -3210,35 +3210,6 @@ nsDOMWindowUtils::IsNodeDisabledForEvents(nsIDOMNode* aNode, bool* aRetVal)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::SetPaintFlashing(bool aPaintFlashing)
|
||||
{
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
if (presContext) {
|
||||
presContext->RefreshDriver()->SetPaintFlashing(aPaintFlashing);
|
||||
// Clear paint flashing colors
|
||||
nsIPresShell* presShell = GetPresShell();
|
||||
if (!aPaintFlashing && presShell) {
|
||||
nsIFrame* rootFrame = presShell->GetRootFrame();
|
||||
if (rootFrame) {
|
||||
rootFrame->InvalidateFrameSubtree();
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GetPaintFlashing(bool* aRetVal)
|
||||
{
|
||||
*aRetVal = false;
|
||||
nsPresContext* presContext = GetPresContext();
|
||||
if (presContext) {
|
||||
*aRetVal = presContext->RefreshDriver()->GetPaintFlashing();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMWindowUtils::DispatchEventToChromeOnly(nsIDOMEventTarget* aTarget,
|
||||
nsIDOMEvent* aEvent,
|
||||
|
@ -1349,9 +1349,4 @@ interface nsIDOMWindowUtils : nsISupports {
|
||||
* attribute or -moz-user-input: none/disabled.
|
||||
*/
|
||||
boolean isNodeDisabledForEvents(in nsIDOMNode aNode);
|
||||
|
||||
/**
|
||||
* Setting paintFlashing to true will flash newly painted area.
|
||||
*/
|
||||
attribute boolean paintFlashing;
|
||||
};
|
||||
|
@ -759,11 +759,22 @@ FrameLayerBuilder::Init(nsDisplayListBuilder* aBuilder, LayerManager* aManager)
|
||||
void
|
||||
FrameLayerBuilder::FlashPaint(gfxContext *aContext)
|
||||
{
|
||||
float r = float(rand()) / RAND_MAX;
|
||||
float g = float(rand()) / RAND_MAX;
|
||||
float b = float(rand()) / RAND_MAX;
|
||||
aContext->SetColor(gfxRGBA(r, g, b, 0.4));
|
||||
aContext->Paint();
|
||||
static bool sPaintFlashingEnabled;
|
||||
static bool sPaintFlashingPrefCached = false;
|
||||
|
||||
if (!sPaintFlashingPrefCached) {
|
||||
sPaintFlashingPrefCached = true;
|
||||
mozilla::Preferences::AddBoolVarCache(&sPaintFlashingEnabled,
|
||||
"nglayout.debug.paint_flashing");
|
||||
}
|
||||
|
||||
if (sPaintFlashingEnabled) {
|
||||
float r = float(rand()) / RAND_MAX;
|
||||
float g = float(rand()) / RAND_MAX;
|
||||
float b = float(rand()) / RAND_MAX;
|
||||
aContext->SetColor(gfxRGBA(r, g, b, 0.2));
|
||||
aContext->Paint();
|
||||
}
|
||||
}
|
||||
|
||||
FrameLayerBuilder::DisplayItemData*
|
||||
@ -3350,10 +3361,7 @@ FrameLayerBuilder::DrawThebesLayer(ThebesLayer* aLayer,
|
||||
aContext->Restore();
|
||||
}
|
||||
|
||||
if (presContext->RefreshDriver()->GetPaintFlashing()) {
|
||||
FlashPaint(aContext);
|
||||
}
|
||||
|
||||
FlashPaint(aContext);
|
||||
if (!aRegionToInvalidate.IsEmpty()) {
|
||||
aLayer->AddInvalidRect(aRegionToInvalidate.GetBounds());
|
||||
}
|
||||
|
@ -528,8 +528,6 @@ nsRefreshDriver::nsRefreshDriver(nsPresContext* aPresContext)
|
||||
mMostRecentRefreshEpochTime = JS_Now();
|
||||
mMostRecentRefresh = TimeStamp::Now();
|
||||
|
||||
mPaintFlashing = Preferences::GetBool("nglayout.debug.paint_flashing");
|
||||
|
||||
mRequests.Init();
|
||||
}
|
||||
|
||||
|
@ -229,17 +229,6 @@ public:
|
||||
*/
|
||||
static int32_t DefaultInterval();
|
||||
|
||||
/**
|
||||
* Enable/disable paint flashing.
|
||||
*/
|
||||
void SetPaintFlashing(bool aPaintFlashing) {
|
||||
mPaintFlashing = aPaintFlashing;
|
||||
}
|
||||
|
||||
bool GetPaintFlashing() {
|
||||
return mPaintFlashing;
|
||||
}
|
||||
|
||||
private:
|
||||
typedef nsTObserverArray<nsARefreshObserver*> ObserverArray;
|
||||
typedef nsTHashtable<nsISupportsHashKey> RequestTable;
|
||||
@ -276,7 +265,6 @@ private:
|
||||
bool mTestControllingRefreshes;
|
||||
bool mViewManagerFlushIsPending;
|
||||
bool mRequestedHighPrecision;
|
||||
bool mPaintFlashing;
|
||||
|
||||
int64_t mMostRecentRefreshEpochTime;
|
||||
mozilla::TimeStamp mMostRecentRefresh;
|
||||
|
@ -51,7 +51,6 @@ MOCHITEST_CHROME_FILES = \
|
||||
test_passpointerevents.html \
|
||||
passpointerevents_window.html \
|
||||
test_bug812817.xul \
|
||||
test_bug847890_paintFlashing.html \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_DEBUG
|
||||
|
@ -1,31 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Tests for paint flashing</title>
|
||||
<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
|
||||
<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
function startTest() {
|
||||
waitForAllPaintsFlushed(function () {
|
||||
var before = snapshotWindow(window, false);
|
||||
SpecialPowers.getDOMWindowUtils(window).paintFlashing = true;
|
||||
document.body.innerHTML = "bar";
|
||||
waitForAllPaintsFlushed(function () {
|
||||
document.body.innerHTML = "foo";
|
||||
waitForAllPaintsFlushed(function () {
|
||||
var after = snapshotWindow(window, false);
|
||||
ok(compareSnapshots(before, after, false)[0], "windows are different");
|
||||
SpecialPowers.getDOMWindowUtils(window).paintFlashing = false;
|
||||
SimpleTest.finish();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="startTest()">foo</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user