зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1070851 - Make touch caret respect snapshotWindow(). r=roc
Avoid capture touch caret when the argument 'withCaret' is false in snapshotWindow().
This commit is contained in:
Родитель
a77fd9691a
Коммит
f8923cff09
|
@ -270,6 +270,11 @@ public:
|
|||
*/
|
||||
void SetAccurateVisibleRegions() { mAccurateVisibleRegions = true; }
|
||||
bool GetAccurateVisibleRegions() { return mAccurateVisibleRegions; }
|
||||
/**
|
||||
* @return Returns true if we should include the caret in any display lists
|
||||
* that we make.
|
||||
*/
|
||||
bool IsBuildingCaret() { return mBuildCaret; }
|
||||
/**
|
||||
* Allows callers to selectively override the regular paint suppression checks,
|
||||
* so that methods like GetFrameForPoint work when painting is suppressed.
|
||||
|
|
|
@ -490,3 +490,4 @@ support-files =
|
|||
bug687297_b.html
|
||||
bug687297_c.html
|
||||
[test_bug990340.html]
|
||||
[test_bug1070851.html]
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1070851
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1070851</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
|
||||
<style>
|
||||
/* Eliminate the blue glow when focusing an element. */
|
||||
input, textarea, div {
|
||||
background: none;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 1070851 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function testSnapshot(aElementId)
|
||||
{
|
||||
var noTouchCaret = snapshotWindow(window, true);
|
||||
|
||||
// Focus the element to make the touch caret show, but do not capture it.
|
||||
var element = document.getElementById(aElementId);
|
||||
element.focus();
|
||||
var notCaptureTouchCaret = snapshotWindow(window, false);
|
||||
|
||||
[result, first, second] = compareSnapshots(noTouchCaret, notCaptureTouchCaret,
|
||||
true);
|
||||
ok(result, "Both snapshots of " + aElementId + " should have no touch caret." +
|
||||
"\nFirst snapshot: " + first + "\nSecond snapshot: " + second);
|
||||
|
||||
element.blur();
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(function() {
|
||||
testSnapshot('input');
|
||||
testSnapshot('textarea');
|
||||
testSnapshot('content');
|
||||
SimpleTest.finish();
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1070851">Mozilla Bug 1070851</a>
|
||||
<input id="input">
|
||||
<textarea id="textarea"></textarea>
|
||||
<div id="content" contenteditable="true">test</div>
|
||||
</body>
|
||||
</html>
|
|
@ -416,6 +416,11 @@ nsCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
nsIFrame* kid;
|
||||
for (kid = GetFirstPrincipalChild(); kid; kid = kid->GetNextSibling()) {
|
||||
// Skip touch caret frame if we do not build caret.
|
||||
if (!aBuilder->IsBuildingCaret() && kid->GetContent() == mTouchCaretElement) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Put our child into its own pseudo-stack.
|
||||
BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче