Closed Bug 236427 Opened 19 years ago Closed 1 year ago

media="handheld" attribute


(Core :: DOM: Core & HTML, defect, P5)






(Reporter: dougt, Unassigned)



(Keywords: mobile)

Investigate adding support in Minimo for media="handheld" attribute.  See:
*** Bug 236428 has been marked as a duplicate of this bug. ***
I've discussed this elsewhere -- we should have a way of setting the medium on
the doc viewer that allows dynamically changing the medium on the pres context
-- there's probably more on the bug on supporting projection medium in full
screen mode.
Blocks: 236580
xref: bug 120398 - ability to specify 'projection' CSS2 media
I've never used Opera for Smartphones and I don't know if Opera process
Pocket IE process both media "screen" and "handheld" at the same time, but this
is buggy behavior. UA should process only one media at time.

I tried Minimo and I think that Minimo is processing only media="screen".

Will Minimo have DOCTYPE switching feature? If page honors W3C standars, Minimo
should do that too.
(Opera supports media="handheld" when available, and switches back to "screen"
when it isn't.)
Target Milestone: --- → Future
over to me.  darin feel free to disagree. :-)
Assignee: darin → dougt
I can't vote for this bug, so I'll annoy everyone with a "me too" comment.  I was very surprised when I downloaded this browser designed for handheld devices, and it completely ignores the handheld stylesheet!  This seems like such a better solution than the "SSR" mode - that's why it was created.

When I'm designing pages that may be viewed on a handheld device, I remove a lot of the 'fluff' like images and such, to save the user from extra downloads, and because big images don't fit too well into a 240px screen!

I will not use this product until it can work properly with handheld CSS, which is too bad, because I like what I see so far (aside from the speed of the program.)
For Newton (and others who need to test pages designed for handhelds on a PC): Opera desktop can be switched to use Small Screen Rendering with Shift-F11, then CSS tagged with media="handheld" is used. Opera desktop is free beer, so why not use it.
Assignee: dougt → nobody
Keywords: mobile
Product: Minimo → Core
Flags: wanted1.9.1?
OS: Windows XP → All
QA Contact: chofmann → general
Hardware: PC → All
Target Milestone: Future → ---
Component: General → DOM: Core & HTML
QA Contact: general → general
dbaron: what is required to do this?
That's rather a question of what "this" is.

If we just want mobile to be "handheld" and not "screen" it's pretty easy, we just need a way to set nsPresContext::mMedium in an embedder-configurable way (e.g., through an API on nsIMarkupDocumentViewer or some such).  (It's currently hard-coded in nsPresContext::nsPresContext to be either screen or print.)

However, I think other browsers that implement this do something more complicated where they act like handheld if handheld style sheets are present and screen otherwise.  So if we want to do something smart, I think we'd need to determine what other browsers do and what we want to do, and then work from there.
Flags: wanted-fennec1.0+
In my extremely unscientific tests, a tried it on three (sorta) mobile devices :

Opera Mini 4 using their demo ( - ignores handheld, uses screen
ipod touch 1st generation - ignores handheld, uses screen
OpenWave mobile browser for the LG8600 - handles handheld. But ignores screen if handheld is not present.

I found the Opera results strange because they claim to support handheld on Opera Mini and Opera Mobile ( And Hixie said in comment 5 that Opera uses handheld.

Personally, Opera's/dbaron's method to fallback to screen if handheld is not present seems like the most reasonable approach.
FYI: We (Opera) are changing our policy because there are quite a few sites out there that give a crap experience when you honor the handheld style sheet. We recommend authors to use media queries instead.
Flags: wanted1.9.1?
Opera Mini, Android or iPhone browser doesn't use handheld but screen media type. Some emulator testing and google code search I found that you can use this:

<link rel="stylesheet" href="style_desktop.css" media="screen and (min-device-width: 481px)" type="text/css" />
<link type="text/css" rel="stylesheet" media="only screen and (max-device-width: 480px)" href="style_mobile.css" />

to set CSS for the mobile, and another for the desktop browsers (except IE of course). Fennec on the PC which I've just downloaded gets the desktop CSS. I may be non-mobile display issue (engine gets info that the screen is big - so desktop css).
> We recommend authors to use media queries instead.

What, exactly, should be queried for?  Screen width?  Then you run the risk of flipping between your desktop and mobile stylesheets when the device changes orientation.

I'm blown away that there's no good way to detect this difference in CSS (or JS, for that matter).  We resort effectively to UA sniffing in our own code (we ship different stylesheets for mobile), which is just embarrassing.
(In reply to Justin Lebar [:jlebar] from comment #14)
> > We recommend authors to use media queries instead.
> What, exactly, should be queried for?  Screen width?  Then you run the risk
> of flipping between your desktop and mobile stylesheets when the device
> changes orientation.

I would say you should probably query for screen width and screen dpi count. I don't really get why it would be a problem to use style designed for desktop if the screen is big enough and the resolution is high (or low) enough. In that case, I would like to have desktop presentation even with mobile device.

If you mean that the style is designed for a touch screen, then you should query touch screen (if that's possible). A mobile device is not the same thing as a touch screen device.

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Closed: 1 year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.