Closed Bug 326926 Opened 19 years ago Closed 19 years ago

Caret 1px too far to the right in empty inputs/textarea's in win2000 theme

Categories

(SeaMonkey :: Themes, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: martijn.martijn, Unassigned)

References

Details

(Keywords: regression)

Attachments

(4 files, 3 obsolete files)

See screenshots I'm going attach. This changed with the fix for bug 326123.
So current trunk build in WinXP theme looks all right, comparable to IE6, but current trunk build in Win2000 theme, it looks like the caret is 1px too far too the right. Uri thinks this might be a cause for this: http://lxr.mozilla.org/mozilla/source/widget/src/windows/nsNativeThemeWin.cpp#958
Cannot one use macros like #if _WIN32_WINNT>=0x0501 ... #else ... #endif for such a case?
(In reply to comment #6) > Cannot one use macros like #if _WIN32_WINNT>=0x0501 ... #else ... #endif for > such a case? > Perhaps. My problem is that I can't work on this since I don't have access to a Windows machine.
Attached patch patch (obsolete) — Splinter Review
Ok, this fixes it for me. Screenshots here for comparison before/after patch and IE6, using classic/winxp themes: http://wargers.org/mozilla/bug326926/326926_caret_comparison.htm I also added some extra vertical padding for winxp inputs/textarea's because they are missing it (see comparison page). Classic theme also needs some extra vertical padding, but when I do that I get a nasty side-effect where the anonymous div inside the input/textarea doesn't fit anymore. I think it could also be fixed, maybe, but then I would also need to change stuff in forms.css and I don't know how that would work on other platforms.
Attachment #214895 - Flags: review?(neil)
(In reply to comment #8) > Classic theme also needs some extra vertical padding, It needs it only for textarea, when you look at the comparison page, that's because inputs already have some extra vertical padding in forms.css: http://lxr.mozilla.org/seamonkey/source/layout/style/forms.css#82
Thanks, Martijn, and sorry again for breaking this and not being able to fix it.
Comment on attachment 214895 [details] [diff] [review] patch > if (aFrame && aWidgetType == NS_THEME_TEXTFIELD) { > nsIContent* content = aFrame->GetContent(); > if (content && content->IsContentOfType(nsIContent::eHTML)) { > // We need to pad textfields by 1 pixel, since the caret will draw > // flush against the edge by default if we don't. > aResult->left++; > aResult->right++; >+ aResult->top = aResult->bottom = 2; Did you try this with XUL textfields, only it looks as if it might belong before the nsIContent* line (compare with ClassicGetWidgetBorder). > // HTML text-fields need extra padding >- (*aResult).left = (*aResult).right = 3; >- else > (*aResult).left = (*aResult).right = 2; >+ else >+ (*aResult).left = (*aResult).right = 1; This change looks reasonable.
Attached patch patch2 (obsolete) — Splinter Review
This patch is dealing only with the part where this bug is about. Perhaps, that is preferred. (In reply to comment #11) > Did you try this with XUL textfields, only it looks as if it might belong > before the nsIContent* line (compare with ClassicGetWidgetBorder). That would make the url bar 2px higher in winxp theme, which isn't happening with the original patch.
Attachment #214903 - Flags: review?(neil)
Comment on attachment 214903 [details] [diff] [review] patch2 On second thoughts, this bit is wrong, because the XUL textbox border should always be 2px; however padding changes in the theme may be necessary.
Attachment #214903 - Flags: review?(neil) → review-
Comment on attachment 214895 [details] [diff] [review] patch > // We need to pad textfields by 1 pixel, since the caret will draw > // flush against the edge by default if we don't. > aResult->left++; > aResult->right++; >+ aResult->top = aResult->bottom = 2; Don't hardcode 2, follow the example given to you.
Attachment #214895 - Flags: review?(neil) → review-
Attached patch patch3 (obsolete) — Splinter Review
So like this, then?
Attachment #214895 - Attachment is obsolete: true
Attachment #214903 - Attachment is obsolete: true
Attachment #214918 - Flags: review?(neil)
Comment on attachment 214918 [details] [diff] [review] patch3 > aResult->left++; > aResult->right++; >+ aResult->top += 1; >+ aResult->bottom += 1; When I said follow the example, I really meant ++; r=me with that fixed. Oh, and file style appears to be top, left, bottom, right so if you could reorder the lines too that would be neat, thanks.
Attachment #214918 - Flags: review?(neil) → review+
Attached patch patch3, revisedSplinter Review
(In reply to comment #16) > When I said follow the example, I really meant ++; r=me with that fixed. Oops.
Attachment #214918 - Attachment is obsolete: true
Comment on attachment 215066 [details] [diff] [review] patch3, revised Neil, sorry, I also need sr+. Can I ask you, or should I ask someone else?
Attachment #215066 - Flags: review?(neil)
Attachment #215066 - Flags: superreview?(neil)
Attachment #215066 - Flags: review?(neil)
Attachment #215066 - Flags: review?
(In reply to comment #18) >Neil, sorry, I also need sr+. >Can I ask you, or should I ask someone else? You could ask ere to review then I can grant sr, or you can ask rbs for sr.
Comment on attachment 215066 [details] [diff] [review] patch3, revised Ok, asking rbs.
Attachment #215066 - Flags: superreview?(neil) → superreview?(rbs)
Comment on attachment 215066 [details] [diff] [review] patch3, revised sr=rbs
Attachment #215066 - Flags: superreview?(rbs) → superreview+
Checking in widget/src/windows/nsNativeThemeWin.cpp; /cvsroot/mozilla/widget/src/windows/nsNativeThemeWin.cpp,v <-- nsNativeThemeWi n.cpp new revision: 3.55; previous revision: 3.54 done
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment on attachment 215066 [details] [diff] [review] patch3, revised This patch was already checked in.
Attachment #215066 - Flags: review?
Product: Core → SeaMonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: