Closed
Bug 536421
Opened 15 years ago
Closed 14 years ago
Reframing a text control inside onfocus loses the caret
Categories
(Core :: Layout: Form Controls, defect)
Core
Layout: Form Controls
Tracking
()
RESOLVED
FIXED
mozilla2.0b7
Tracking | Status | |
---|---|---|
blocking2.0 | --- | final+ |
People
(Reporter: bzbarsky, Assigned: MatsPalmgren_bugz)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 2 obsolete files)
700 bytes,
text/html
|
Details | |
1.32 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
4.43 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
Testcase attached. See also bug 536172.
Updated•14 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Comment 2•14 years ago
|
||
Requesting blocking-2.0 flag because it blocks bug 553097 which is a 2.0 blocker.
blocking2.0: --- → ?
Mats, you can probably take this
Assignee: nobody → matspal
blocking2.0: ? → final+
Comment 6•14 years ago
|
||
Once we have a patch for this bug, we should test to make sure it's solving the duplicate bugs as well.
Assignee | ||
Comment 7•14 years ago
|
||
Assignee | ||
Comment 8•14 years ago
|
||
This fixes it for me locally. I've pushed it to Try - I'll ask for review if it passes unit tests.
Assignee | ||
Comment 9•14 years ago
|
||
The test doesn't need privileges so a regular reftest will do.
Attachment #480826 -
Attachment is obsolete: true
Assignee | ||
Updated•14 years ago
|
Attachment #480830 -
Flags: review?(ehsan)
Comment 10•14 years ago
|
||
Comment on attachment 480830 [details] [diff] [review] Patch rev. 1 Makes sense. Did you also test this patch with the duplicate bug reports in this bug?
Attachment #480830 -
Flags: review?(ehsan) → review+
Comment 11•14 years ago
|
||
Comment on attachment 480981 [details] [diff] [review] reftest.diff >+ timer = setTimeout(finishTest, 5000); // if onfocus is never called Why is this necessary? If onfocus is never called, the reftest will just time out, right? >+input { border:1px solid blue; } Nit: why is this necessary? >diff --git a/layout/reftests/forms/reftest.list b/layout/reftests/forms/reftest.list Could you please add this reftest to layout/reftests/editor? Thanks!
Assignee | ||
Comment 12•14 years ago
|
||
> >+ timer = setTimeout(finishTest, 5000); // if onfocus is never called > > Why is this necessary? Unit test tinderboxes are known to have intermittent focus issues. > If onfocus is never called, the reftest will just time out, right? I honestly don't know what happens for a class=reftest-wait test if the class isn't removed. Even if the harness has a timeout, it will still cause an orange? The timeout doesn't hurt so I'll leave it in unless you see a problem with that. > >+input { border:1px solid blue; } > > Nit: why is this necessary? To disable native themes affecting the test in any way. > Could you please add this reftest to layout/reftests/editor? Thanks! Will do.
Comment 13•14 years ago
|
||
(In reply to comment #12) > > >+ timer = setTimeout(finishTest, 5000); // if onfocus is never called > > > > Why is this necessary? > > Unit test tinderboxes are known to have intermittent focus issues. Sure (although I've never seen any such problems personally, but it's worth protecting against it). See below. > > If onfocus is never called, the reftest will just time out, right? > > I honestly don't know what happens for a class=reftest-wait test if the > class isn't removed. Even if the harness has a timeout, it will > still cause an orange? The timeout doesn't hurt so I'll leave it in > unless you see a problem with that. What happens if the test doesn't remove reftest-wait in a timely fashion is that it will time out and cause an orange. With this timeout in place, it won't time out, and if we're really unlucky, the test will pass even if the rendering is not the same. Therefore, I'd really rather we don't use a timeout this way, to make sure that the test will fail if the input is never focused. > > >+input { border:1px solid blue; } > > > > Nit: why is this necessary? > > To disable native themes affecting the test in any way. But it shouldn't. This is the sort of thing which might mask a regression in the future, so I think you should remove it as well. > > Could you please add this reftest to layout/reftests/editor? Thanks! > > Will do. Awesome, thanks!
Assignee | ||
Comment 14•14 years ago
|
||
> Therefore, I'd really rather we don't use a timeout > this way, to make sure that the test will fail if the input is never focused. Fortunately the Tbox focus issues are rare so the test not running would be rare. Personally, I think those intermittent oranges are just annoying and if there's a real regression the test would flag that soon enough. Also, people don't like reftests to hang when the window doesn't have focus. I had to add a timeout to fix a test in bug 564413. Are you sure you want me to remove the timeout? > > > >+input { border:1px solid blue; } > But it shouldn't. This is the sort of thing which might mask a regression in > the future... But the opposite is equally true - the theme might mask a regression.
Reporter | ||
Comment 15•14 years ago
|
||
Mats, does that patch fix bug 602130?
Comment 16•14 years ago
|
||
(In reply to comment #14) > > Therefore, I'd really rather we don't use a timeout > > this way, to make sure that the test will fail if the input is never focused. > > Fortunately the Tbox focus issues are rare so the test not running > would be rare. Personally, I think those intermittent oranges are > just annoying and if there's a real regression the test would flag > that soon enough. But if there's a real failure, this will be perma-orange. And something causes intermittent focus problems, many of the tests in layout/reftests/editor will go orange. In fact, that's half of the reason I asked you to move the test there! :-) > Also, people don't like reftests to hang when the window doesn't > have focus. I had to add a timeout to fix a test in bug 564413. > Are you sure you want me to remove the timeout? Yes! That's the other half of the reason that I asked you to move the test there, as most of the tests in that directory need the browser to be in foreground and focused. I don't know what the ideal situation with regards to bug 564413 is, but we know for a fact that the reftests in that directory are going to fail if the browser is not in the foreground. <rant> I was one of the people that hated the reftest framework to break down if not in foreground (the crashtest framework doesn't to the best of my knowledge). But there were some placeholder tests which simply couldn't operate correctly without focus, so I finally gave up! And given the fact that every other test framework that we have except for crashtest and xpcshell-tests also requires focus, I think I'm in a rather strong position to defend this, even though I'm acting as devil's advocate here! </rant> > > > > >+input { border:1px solid blue; } > > But it shouldn't. This is the sort of thing which might mask a regression in > > the future... > > But the opposite is equally true - the theme might mask a regression. Sure, but we *really* want to catch the regressions which are _not_ theme-related. Now that you mentioned it though, how about adding both series of tests? :-)
Assignee | ||
Comment 17•14 years ago
|
||
Removed the timer. Tests with and without theme.
Attachment #480981 -
Attachment is obsolete: true
Comment 18•14 years ago
|
||
> Removed the timer. Tests with and without theme.
You should probably use "-moz-appearance: none;" instead of assuming a border rule is removing the native appearance.
Comment 19•14 years ago
|
||
Comment on attachment 481139 [details] [diff] [review] reftest2.diff r=me with Mounir's comment addressed.
Attachment #481139 -
Flags: review+
Comment 20•14 years ago
|
||
(In reply to comment #15) > Mats, does that patch fix bug 602130? FWIW, the fix to this bug should also fix bug 602130. Mats said that it doesn't, however, which means that this fix is not complete.
Updated•14 years ago
|
Whiteboard: [needs new patch]
Assignee | ||
Comment 21•14 years ago
|
||
Let's deal with the caret position in bug 602130. http://hg.mozilla.org/mozilla-central/rev/e841ade1b0c5
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Updated•14 years ago
|
Target Milestone: mozilla2.0b8 → mozilla2.0b7
You need to log in
before you can comment on or make changes to this bug.
Description
•