зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 55bb4c4449cd (bug 1637476) as requested by dev CLOSED TREE
This commit is contained in:
Родитель
6a9fbb22ed
Коммит
aa3f65786f
|
@ -1,24 +0,0 @@
|
|||
<!doctype html>
|
||||
<html class="reftest-wait">
|
||||
<title>Reference: Caret is correctly painted with placeholder opacity:1</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<style>
|
||||
input {
|
||||
-webkit-appearance:none; /* to avoid bug 1637804 */
|
||||
/* reset any UA styles and use colors that won't trigger anti-aliasing issues */
|
||||
background: white;
|
||||
border: 1px solid black;
|
||||
outline: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<input>
|
||||
<script>
|
||||
SimpleTest.waitForFocus(function() {
|
||||
document.querySelector('input').focus();
|
||||
requestAnimationFrame(function() {
|
||||
requestAnimationFrame(function() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -1,24 +0,0 @@
|
|||
<!doctype html>
|
||||
<html class="reftest-wait">
|
||||
<title>Caret is correctly painted with placeholder opacity:1</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<style>
|
||||
input::placeholder {
|
||||
background: white;
|
||||
opacity: 1;
|
||||
}
|
||||
input {
|
||||
-webkit-appearance:none; /* to avoid bug 1637804 */
|
||||
/* reset any UA styles and use colors that won't trigger anti-aliasing issues */
|
||||
background: white;
|
||||
border: 1px solid black;
|
||||
outline: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<input placeholder=" ">
|
||||
<script>
|
||||
SimpleTest.waitForFocus(function() {
|
||||
document.querySelector('input').focus();
|
||||
setTimeout(function(){document.documentElement.removeAttribute("class");}, 0);
|
||||
});
|
||||
</script>
|
|
@ -1,24 +0,0 @@
|
|||
<!doctype html>
|
||||
<html class="reftest-wait">
|
||||
<title>Reference: Caret is correctly painted with placeholder opacity:1</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<style>
|
||||
input {
|
||||
-webkit-appearance:none; /* to avoid bug 1637804 */
|
||||
/* reset any UA styles and use colors that won't trigger anti-aliasing issues */
|
||||
background: white;
|
||||
border: 1px solid black;
|
||||
outline: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<input type=password>
|
||||
<script>
|
||||
SimpleTest.waitForFocus(function() {
|
||||
document.querySelector('input').focus();
|
||||
requestAnimationFrame(function() {
|
||||
requestAnimationFrame(function() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -1,24 +0,0 @@
|
|||
<!doctype html>
|
||||
<html class="reftest-wait">
|
||||
<title>Caret is correctly painted with placeholder opacity:1</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<style>
|
||||
input::placeholder {
|
||||
background: white;
|
||||
opacity: 1;
|
||||
}
|
||||
input {
|
||||
-webkit-appearance:none; /* to avoid bug 1637804 */
|
||||
/* reset any UA styles and use colors that won't trigger anti-aliasing issues */
|
||||
background: white;
|
||||
border: 1px solid black;
|
||||
outline: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<input type=password placeholder=" ">
|
||||
<script>
|
||||
SimpleTest.waitForFocus(function() {
|
||||
document.querySelector('input').focus();
|
||||
setTimeout(function(){document.documentElement.removeAttribute("class");}, 0);
|
||||
});
|
||||
</script>
|
|
@ -1,24 +0,0 @@
|
|||
<!doctype html>
|
||||
<html class="reftest-wait">
|
||||
<title>Reference: Caret is correctly painted with placeholder opacity:1</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<style>
|
||||
input {
|
||||
-webkit-appearance:none; /* to avoid bug 1637804 */
|
||||
/* reset any UA styles and use colors that won't trigger anti-aliasing issues */
|
||||
background: white;
|
||||
border: 1px solid black;
|
||||
outline: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<input type=number>
|
||||
<script>
|
||||
SimpleTest.waitForFocus(function() {
|
||||
document.querySelector('input').focus();
|
||||
requestAnimationFrame(function() {
|
||||
requestAnimationFrame(function() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -1,24 +0,0 @@
|
|||
<!doctype html>
|
||||
<html class="reftest-wait">
|
||||
<title>Caret is correctly painted with placeholder opacity:1</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<style>
|
||||
input::placeholder {
|
||||
background: white;
|
||||
opacity: 1;
|
||||
}
|
||||
input {
|
||||
-webkit-appearance:none; /* to avoid bug 1637804 */
|
||||
/* reset any UA styles and use colors that won't trigger anti-aliasing issues */
|
||||
background: white;
|
||||
border: 1px solid black;
|
||||
outline: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<input type=number placeholder=" ">
|
||||
<script>
|
||||
SimpleTest.waitForFocus(function() {
|
||||
document.querySelector('input').focus();
|
||||
setTimeout(function(){document.documentElement.removeAttribute("class");}, 0);
|
||||
});
|
||||
</script>
|
|
@ -363,12 +363,6 @@ support-files =
|
|||
bug1634543-4.html
|
||||
bug1634743-1.html
|
||||
bug1634743-1-ref.html
|
||||
bug1637476-1.html
|
||||
bug1637476-1-ref.html
|
||||
bug1637476-2.html
|
||||
bug1637476-2-ref.html
|
||||
bug1637476-3.html
|
||||
bug1637476-3-ref.html
|
||||
image_rgrg-256x256.png
|
||||
input-invalid-ref.html
|
||||
input-maxlength-invalid-change.html
|
||||
|
|
|
@ -271,9 +271,6 @@ var tests = [
|
|||
[ 'bug1634543-4.html' , 'bug1634543-1-ref.html' ] ,
|
||||
// Caret + line-height + pseudo-element only.
|
||||
[ 'bug1634743-1.html' , 'bug1634743-1-ref.html' ] ,
|
||||
[ 'bug1637476-1.html' , 'bug1637476-1-ref.html' ] ,
|
||||
[ 'bug1637476-2.html' , 'bug1637476-2-ref.html' ] ,
|
||||
[ 'bug1637476-3.html' , 'bug1637476-3-ref.html' ] ,
|
||||
function() {SpecialPowers.pushPrefEnv({'clear': [['layout.accessiblecaret.enabled_on_touch']]}, nextTest);} ,
|
||||
function() {SpecialPowers.pushPrefEnv({'set': [['accessibility.browsewithcaret', true]]}, nextTest);} ,
|
||||
[ 'bug1529492-1.html' , 'bug1529492-1-ref.html' ] ,
|
||||
|
|
|
@ -1290,44 +1290,29 @@ void nsTextControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
nsDisplayList* content = aLists.Content();
|
||||
nsDisplayListSet set(content, content, content, content, content, content);
|
||||
|
||||
// Clip the placeholder and preview text to the root box, so that it doesn't,
|
||||
// e.g., overlay with our <input type="number"> spin buttons.
|
||||
//
|
||||
// For other input types, this will be a noop since we size the root via
|
||||
// ReflowTextControlChild, which sets the same available space for all
|
||||
// children.
|
||||
auto clipToRoot = [&](Maybe<DisplayListClipState::AutoSaveRestore> aClip) {
|
||||
if (mRootNode) {
|
||||
if (auto* root = mRootNode->GetPrimaryFrame()) {
|
||||
aClip.emplace(aBuilder);
|
||||
nsRect rootBox(aBuilder->ToReferenceFrame(root), root->GetSize());
|
||||
aClip->ClipContentDescendants(rootBox);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// We build the ::placeholder first so that it renders below mRootNode which
|
||||
// draws the caret and we always want that on top (bug 1637476).
|
||||
if (mPlaceholderDiv && control->GetPlaceholderVisibility() &&
|
||||
mPlaceholderDiv->GetPrimaryFrame()) {
|
||||
Maybe<DisplayListClipState::AutoSaveRestore> overlayTextClip;
|
||||
clipToRoot(overlayTextClip);
|
||||
auto* kid = mPlaceholderDiv->GetPrimaryFrame();
|
||||
MOZ_ASSERT(kid->GetParent() == this);
|
||||
BuildDisplayListForChild(aBuilder, kid, set, 0);
|
||||
}
|
||||
|
||||
for (auto* kid : mFrames) {
|
||||
for (nsIFrame* kid = mFrames.FirstChild(); kid; kid = kid->GetNextSibling()) {
|
||||
nsIContent* kidContent = kid->GetContent();
|
||||
Maybe<DisplayListClipState::AutoSaveRestore> overlayTextClip;
|
||||
if (kidContent == mPlaceholderDiv) {
|
||||
continue; // we handled mPlaceholderDiv explicitly above
|
||||
if (kidContent == mPlaceholderDiv && !control->GetPlaceholderVisibility()) {
|
||||
continue;
|
||||
}
|
||||
if (kidContent == mPreviewDiv && !control->GetPreviewVisibility()) {
|
||||
continue;
|
||||
}
|
||||
if (kidContent == mPreviewDiv) {
|
||||
clipToRoot(overlayTextClip);
|
||||
// Clip the preview text to the root box, so that it doesn't, e.g., overlay
|
||||
// with our <input type="number"> spin buttons.
|
||||
//
|
||||
// For other input types, this will be a noop since we size the root via
|
||||
// ReflowTextControlChild, which sets the same available space for all
|
||||
// children.
|
||||
if (kidContent == mPlaceholderDiv || kidContent == mPreviewDiv) {
|
||||
if (mRootNode) {
|
||||
if (auto* root = mRootNode->GetPrimaryFrame()) {
|
||||
overlayTextClip.emplace(aBuilder);
|
||||
nsRect rootBox(aBuilder->ToReferenceFrame(root), root->GetSize());
|
||||
overlayTextClip->ClipContentDescendants(rootBox);
|
||||
}
|
||||
}
|
||||
}
|
||||
BuildDisplayListForChild(aBuilder, kid, set, 0);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче