mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 303896 - Turn on displaying the selection when the 'disabled' attr is removed if the element has focus. r=ehsan
This commit is contained in:
parent
3881778c25
commit
976dee9ded
@ -1165,9 +1165,11 @@ nsTextControlFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
else
|
||||
{ // unset disabled
|
||||
flags &= ~(nsIPlaintextEditor::eEditorDisabledMask);
|
||||
selCon->SetDisplaySelection(nsISelectionController::SELECTION_HIDDEN);
|
||||
if (nsContentUtils::IsFocusedContent(mContent)) {
|
||||
selCon->SetDisplaySelection(nsISelectionController::SELECTION_ON);
|
||||
selCon->SetCaretEnabled(true);
|
||||
} else {
|
||||
selCon->SetDisplaySelection(nsISelectionController::SELECTION_HIDDEN);
|
||||
}
|
||||
}
|
||||
editor->SetFlags(flags);
|
||||
|
@ -4,3 +4,4 @@ skip-if(B2G) fails-if(Android) == size-2.html size-2-ref.html
|
||||
HTTP(..) == baseline-1.html baseline-1-ref.html
|
||||
HTTP(..) == centering-1.xul centering-1-ref.xul
|
||||
== dynamic-height-1.xul dynamic-height-1-ref.xul
|
||||
needs-focus == select.html select-ref.html
|
||||
|
18
layout/reftests/forms/input/text/select-ref.html
Normal file
18
layout/reftests/forms/input/text/select-ref.html
Normal file
@ -0,0 +1,18 @@
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function finishTest() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
function runTest() {
|
||||
var field = document.getElementById('field');
|
||||
field.focus();
|
||||
field.select();
|
||||
setTimeout(finishTest, 0);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="runTest()">
|
||||
<input id="field" type="text" value="1234">
|
||||
</body>
|
||||
</html>
|
21
layout/reftests/forms/input/text/select.html
Normal file
21
layout/reftests/forms/input/text/select.html
Normal file
@ -0,0 +1,21 @@
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function finishTest() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
function runTest() {
|
||||
var field = document.getElementById('field');
|
||||
field.focus();
|
||||
field.disabled = true;
|
||||
field.setSelectionRange(0, 4);
|
||||
field.disabled = false;
|
||||
field.select();
|
||||
setTimeout(finishTest, 0);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="runTest()">
|
||||
<input id="field" type="text" value="1234">
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user