Closed Bug 562219 Opened 14 years ago Closed 2 years ago

Implement -moz-appearance: searchfield; for windows widget

Categories

(Core :: Widget: Win32, task, P5)

task

Tracking

()

RESOLVED WONTFIX

People

(Reporter: mounir, Unassigned)

References

()

Details

(Keywords: dev-doc-needed, good-first-bug, Whiteboard: [lang=c++])

Attachments

(4 files)

We can use SEBP_SEARCHEDITBOXTEXT which is Windows 7 only and fallback on something else like a basic textfield for other Windows version. This would help having a native <input type='search'> style on Windows.

robarnold, I'm CCing you because roc told me you could be interested in doing it.
I do not think I will have time to do this until September or October. I'm CC'ing Kai and Dão in case they have the time/interest to do this sooner.
That's really weird but SEBP_SEARCHEDITBOXTEXT is defined into MSDN documentation [1] but not into the source code (vsstyle.h and vssym32.h in Windows SDK v7.0 and v7.1) . It looks like it's the only class not defined. So, I'm wondering why: is that a mistake or it's defined somewhere else?

I didn't tried to use it in a simple program because that would took me a lot of time (i'm not used to windows dev). I tried to ask on MSDN support forum for windows sdk [2] but I still didn't get any answer.

If anyone in CC is used to Windows dev, would you have any idea where this is defined... if it is.

[1] http://msdn.microsoft.com/en-us/library/bb773210%28VS.85%29.aspx
[2] http://social.msdn.microsoft.com/Forums/en-US/windowssdk/thread/02be944f-7be1-4019-bb92-002acdec98e7
Don't suppose you can guess values for the part and state?
Doesn't look like there are any states, and there's only one part, so theme = "SEARCHEDITBOX", part and state = 1? Wouldn't be the first time we found missing constants in the the theme library headers. :)
Attached patch WIP PatchSplinter Review
I followed your advices and I tried with aPart = 1 and aState = 1 and I got something. However, I'm wondering if I doesn't need some tweak.

Screenshots coming.
Assignee: nobody → mounir.lamouri
Status: NEW → ASSIGNED
Attached image Screenshot on focus
This screenshot is a searchfield ala windows 7 (I suppose, I'm not a Windows user).
The one I've got is not so far (background-color, placeholder and icon are not expected in moz-appearance). But I'm wondering why I got a black border when the native widget seems to be much more like grey. Any idea?
Attachment #459011 - Flags: feedback?(tellrob)
(In reply to comment #5)
> Created attachment 459011 [details] [diff] [review]
> WIP Patch
> 
> I followed your advices and I tried with aPart = 1 and aState = 1 and I got
> something. However, I'm wondering if I doesn't need some tweak.
> 
> Screenshots coming.

Where's the code that sets up NS_THEME_SEARCHFIELD? Is that in some other patch?
It was added in bug 450800.
(In reply to comment #8)
> Created attachment 459016 [details]
> Screenshot of what we may want to have
> 
> This screenshot is a searchfield ala windows 7 (I suppose, I'm not a Windows
> user).
> The one I've got is not so far (background-color, placeholder and icon are not
> expected in moz-appearance). But I'm wondering why I got a black border when
> the native widget seems to be much more like grey. Any idea?

I'm guessing that the SearchEditBox theme isn't fully implemented (perhaps this is why it's not in the SDK or well documented).

Stepping back for a moment, can't we just style the search box via CSS? The native theming native code isn't great at picking out fonts which looks like the defining change for native search fields. Otherwise, they look a lot like a regular edit box, right? I also noticed that all the search fields in Vista/7 appear to be on glass which is not the case for search fields in HTML5 content.
Yeah, given this it seems like we'll have to wait with figuring out how to use native rendering on windows 7 and fall back to using a CSS-based solution. Like we will for Windows XP.
Comment on attachment 459011 [details] [diff] [review]
WIP Patch

Canceling feedback request per previous comments.

I guess we are going to use the same style on Windows XP and Windows 7 then.

Rob, having a widget not fully implemented in the SDK is something common or quite unusual? If that's common can we expect a full implementation with a SDK update?
Attachment #459011 - Flags: feedback?(tellrob)
(In reply to comment #13)
> Comment on attachment 459011 [details] [diff] [review]
> WIP Patch
> 
> Canceling feedback request per previous comments.
> 
> I guess we are going to use the same style on Windows XP and Windows 7 then.

We can do a separate style for Windows Vista/7 via chrome overrides. See browser-aero.css for some styling that's only loaded on Vista/7.

> Rob, having a widget not fully implemented in the SDK is something common or
> quite unusual? If that's common can we expect a full implementation with a SDK
> update?

It is quite unusual to be this unimplemented. I would not wait for an SDK update to fix this.
Blocks: 756437
No longer blocks: 756437
Assignee: mounir → nobody
Mentor: jmathies, tabraldes, netzen
Whiteboard: [good first bug][lang=c++]
Hello i am interested in resolving this bug. 

1-By far what i have understood is that it's getting difficult to implement search widget in different versions of windows and so finally we have to go using same implementation for all.

2- And what does this dev-doc-needed means,does this reflect to developers or it also has to be written in this bug.

Please correct me wherever i am wrong.
Mentor: jmathies, netzen, timabraldes
Priority: -- → P5
Keywords: good-first-bug
Whiteboard: [good first bug][lang=c++] → [lang=c++]
Type: defect → task
No longer blocks: 558594
Depends on: 558594

We have switched to non-native theming of form controls in bug 1535761 and dependent bugs.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: