Closed
Bug 193316
Opened 22 years ago
Closed 19 years ago
Caret, and thus focus, not visible in readonly text field
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha8
People
(Reporter: jln, Assigned: aaronlev)
References
(Blocks 1 open bug)
Details
(Keywords: access)
Attachments
(5 files)
(deleted),
text/html
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
patch
|
sfraser_bugs
:
superreview+
|
Details | Diff | Splinter Review |
(deleted),
application/vnd.mozilla.xul+xml
|
Details | |
(deleted),
patch
|
mrbkap
:
review+
sfraser_bugs
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030210
When the attached page is viewed the focus marker (the I-bar/cursor)
disappears. The problem is the "inputElement.readOnly = true" statement. If
this is removed then it works.
Even though the I-bar disappears text is still entered the right place.
Reproducible: Always
Steps to Reproduce:
Reporter | ||
Comment 1•22 years ago
|
||
Comment 2•22 years ago
|
||
Over to aaronl... Happens on current linux trunk too.
Assignee: jst → aaronl
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Hardware: PC → All
Assignee | ||
Updated•20 years ago
|
Assignee | ||
Updated•20 years ago
|
Priority: -- → P2
Assignee | ||
Updated•19 years ago
|
Target Milestone: --- → mozilla1.9beta
Assignee | ||
Updated•19 years ago
|
Flags: blocking1.8b5?
Whiteboard: [ Blocking 1.8b5? ]
Assignee | ||
Comment 3•19 years ago
|
||
Comment 5•19 years ago
|
||
feel free to show us a patch for evaluation but we're not going to block on this
failure.
Flags: blocking1.8b5? → blocking1.8b5-
Assignee | ||
Comment 6•19 years ago
|
||
The condition to avoid enabling the caret for the readonl editor goes back to a
checkin by Buster in v1.77 of that file.
Attachment #197947 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #197947 -
Flags: review?(sfraser_bugs)
Comment 7•19 years ago
|
||
I take it that the caret shows up, but does not blink with this patch?
Assignee | ||
Comment 8•19 years ago
|
||
(In reply to comment #7)
> I take it that the caret shows up, but does not blink with this patch?
That's right. And I tested to make sure it doesn't get stuck in a nonblinking
state. Once you go back to an editable field it blinks again.
Updated•19 years ago
|
Attachment #197947 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #197947 -
Flags: superreview+
Attachment #197947 -
Flags: review?(sfraser_bugs)
Attachment #197947 -
Flags: review?(neil.parkwaycc.co.uk)
Assignee | ||
Updated•19 years ago
|
Attachment #197947 -
Flags: review?(neil.parkwaycc.co.uk) → review?(bzbarsky)
Comment 9•19 years ago
|
||
Comment on attachment 197947 [details] [diff] [review]
Enable readonly caret for readonly editors
This works great in HTML, but for some reason it doesn't quite work in XUL; I
am experiencing two issues:
a) when an existing selection in a textbox is collapsed for some reason (e.g.
pressing an arrow key) the caret does not appear.
b) when clicking on a readonly textbox the caret does not appear, nor does it
disappear from the previous textbox! If you go on to click in a third readonly
textbox it then appears where you originally clicked in the second textbox and
so on.
Note that subsequent arrow keys or clicks in the same textbox show the readonly
caret correctly.
Comment 10•19 years ago
|
||
Comment on attachment 197947 [details] [diff] [review]
Enable readonly caret for readonly editors
I'm not a qualified reviewer for this code. Please have an editor peer review,
ok?
Attachment #197947 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 11•19 years ago
|
||
Neil, the main problem that I'm seeing is that the mouse is somehow affecting
the caret.
Assignee | ||
Comment 12•19 years ago
|
||
1) Make sure the caret's readonly status is set before we enable it, because
that affects whether PrimeTimer() does anything
2) When caret is erased via EraseCaret() prior to painting, make sure it gets
redisplayed when it was readonly and didn't have a blink timer. We do this by
reusing the blink timer for a one shot timer with length 0
3) In StartBlinking() the selection is sometimes not set yet causing the
initial draw to fail. When it's a blinking caret it's hard to notice that
because eventually the caret gets drawn anyway. For the readonly caret we need
to make sure it gets drawn after the selection. I just reused the brief one
shot timer trick to make sure this happens after the selection had to be set.
That might be hacky but what's a clean way that doesn't change a lot of code?
Attachment #198272 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 13•19 years ago
|
||
Comment on attachment 198272 [details] [diff] [review]
Resolves XUL textbox problems but we probably need something less hacky. Open to suggestions.
Sorry, I don't know caret code, try mrbkap or glazou?
Attachment #198272 -
Flags: review?(neil.parkwaycc.co.uk)
Assignee | ||
Updated•19 years ago
|
Attachment #198272 -
Flags: review?(mrbkap)
Comment 14•19 years ago
|
||
Comment on attachment 198272 [details] [diff] [review]
Resolves XUL textbox problems but we probably need something less hacky. Open to suggestions.
I guess this is OK if you're trying to get this into the branch, but we should
really try to find a better way to do this...
>Index: editor/libeditor/text/nsEditorEventListeners.cpp
>@@ -1041,14 +1041,13 @@ nsTextEditorFocusListener::Focus(nsIDOME
>+ const kIsReadonly = (flags & nsIPlaintextEditor::eEditorReadonlyMask) != 0;
|const PRBool|, perhaps? I guess the k prefix belongs, here, though I always
thought of that as more of a "static const" sort of prefix.
r=mrbkap
Attachment #198272 -
Flags: review?(mrbkap) → review+
Assignee | ||
Updated•19 years ago
|
Attachment #198272 -
Flags: superreview?(sfraser_bugs)
Comment 15•19 years ago
|
||
Comment on attachment 198272 [details] [diff] [review]
Resolves XUL textbox problems but we probably need something less hacky. Open to suggestions.
+ const kIsReadonly
Yeah, const PRBool please (it will be an int by default).
Attachment #198272 -
Flags: superreview?(sfraser_bugs) → superreview+
Assignee | ||
Updated•19 years ago
|
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 16•19 years ago
|
||
*** Bug 89689 has been marked as a duplicate of this bug. ***
Comment 17•19 years ago
|
||
although the caret does not blink, one can still think the textfield is editable, so someone could press the backspace and would be surprised to see that the browser goes back in history, see discussion in bug 332345.
Updated•17 years ago
|
Whiteboard: [ Blocking 1.8b5? ]
Comment 18•6 years ago
|
||
Keywords: sec508
You need to log in
before you can comment on or make changes to this bug.
Description
•