Csswg-drafts: [css-device-adapt] Remove @viewport

Created on 10 Feb 2020  Â·  13Comments  Â·  Source: w3c/csswg-drafts

https://www.w3.org/TR/css-device-adapt-1/#atviewport-rule

The @viewport rule in this spec has not gained traction. I propose that we remove it, and use the spec to simply define the <meta name="viewport"> tag.

Closed Accepted by CSSWG Resolution Needs Edits css-device-adapt-1

Most helpful comment

I like @viewport, but I cannot disagree about its lack of traction. In fact, it's lost traction: it used to ship in Opera and IE, but with the demise of those as standalone engines, it's no longer in any modern browser. That makes me sad, but it's nonetheless true.

Also, the viewport meta needs a spec.

Also, we recently discussed specifying the definitions of layout viewport and visual viewport, and temporarily agreed that they could go in cssom-view, but there was some reluctance about that due to the fact that not all implementations that care about the viewport have an OM, so the coupling felt wrong.

With all that in mind, moving the definitions of the viewports here, defining the viewport meta alongside, and removing the rest seems sensible to me.

There are a number of useful things that @viewport does/did that the meta viewport doesn't do, so it would probably be good to set up an explainer somewhere to preserve those, in the hope that we'll get back to this some day, but the current state of affairs doesn't help anyone.

All 13 comments

Issue #258 has some relevant discussion. If browsers are unwilling to implement, then there's no point keeping @viewport around. Punting it to the next level just kicks the can down the road.

I like @viewport, but I cannot disagree about its lack of traction. In fact, it's lost traction: it used to ship in Opera and IE, but with the demise of those as standalone engines, it's no longer in any modern browser. That makes me sad, but it's nonetheless true.

Also, the viewport meta needs a spec.

Also, we recently discussed specifying the definitions of layout viewport and visual viewport, and temporarily agreed that they could go in cssom-view, but there was some reluctance about that due to the fact that not all implementations that care about the viewport have an OM, so the coupling felt wrong.

With all that in mind, moving the definitions of the viewports here, defining the viewport meta alongside, and removing the rest seems sensible to me.

There are a number of useful things that @viewport does/did that the meta viewport doesn't do, so it would probably be good to set up an explainer somewhere to preserve those, in the hope that we'll get back to this some day, but the current state of affairs doesn't help anyone.

The CSS Working Group just discussed [css-device-adapt] Remove @viewport, and agreed to the following:

  • RESOLVED: Remove @viewport, retire the spec, move the meta tag to a new spec (CSS Viewport)
  • RESOLVED: Move layout visual viewport spec into CSS Viewport spec

The full IRC log of that discussion
<dael> Topic: [css-device-adapt] Remove @viewport

<dael> github: https://github.com/w3c/csswg-drafts/issues/4766

<dael> smfr: Since @viewport hasn't tracktion on shipping browsers I propose we remove and just spec the metatag which has wide support

<dael> TabAtkins: Support

<dael> florian: Yeah, I'm editor. I like @viewport but I can't disagree. It doesn't have traction

<dael> florian: Related; we resolved to define the viewports and CSSOM View as the host. If device adaptation doesn't contain @viewport this is a good host for them. Should we move

<dael> smfr: Don't agree b/c spec of layout and visual viewports is about layout, not about adapting to devices. That's why i think like elsewhere. This is right for tap highlight color or things only for devices.

<dael> florian: Why I'm not happy with them in CSSOM View is not all things care about viewports have OM. Where else it should live, this felt okay. i can live elsewhere. I don't feel OM view is a better home

<dael> smfr: I think OM View is a bad name for a spec.

<dael> fantasai: I agree with them in device adaptation. Less convinced with things that are touch specific. It's fundimental to a lot of devices and I think it goes in UI. But I agree with dropping @viewport and shifting meta viewport into device adaptation

<dael> florian: If device adaptation name is the problem we can retire as a note and have a new spec called viewports

<dael> smfr: That would be fine. If layout and viewport is moved to another spec I should be editor on that.

<dael> smfr: Layout and visual viewport will tie into scrolling and coord system for getBoundingClientRect. That's why I think more closely with OM View

<dael> florian: A bunch need to refer to them but that's not defining what they are

<dael> Rossen_: We are moving away from original topic. Given that we don't have layout and viewports spec yet we can decide where to host once we have spec text closer.

<dael> Rossen_: Back to original proposal to remove @viewport. I didn't hear any challenges and I hear support.

<dael> Rossen_: Obj to removing @viewport?

<dael> florian: Don't object. Suggest we retire spec

<dael> smfr: Need live spec for meta viewport

<dael> florian: Yeah, cal it viewport spec

<dael> tantek: Drop from lack of impl interest?

<dael> many: yes

<dael> florian: Proposed by Opera, drop by MS, and then both companies switched engines and Google had concerns

<florian> s/drop by MS/adopted by MS/

<dael> Rossen_: And we didn't have any use of it. Adding it didn't add to capabilities we had. No one has asked for it after we decided to move on to Blink platform

<tantek> Gecko BTW: https://bugzilla.mozilla.org/show_bug.cgi?id=747754

<dael> tantek: Checking Mozilla bug ^

<dael> Rossen_: tantek are you trying to push back on resolution?

<florian> s/switched engines/switched to engines that lack that feature/

<dael> tantek: I read GH and hearing reasoning from absense of evidence. I wanted to site relevent Gecko bugs and I guess Blink.

<dael> florian: Google has objected to it

<smfr> https://github.com/w3c/csswg-drafts/issues/258

<dael> tantek: I didn't see that in the bug. It wasn't linked. That's a strong claim so I'd like a link

<dael> smfr: There's a link to ^ from Google saying @viewport is loader hostile

<dael> florian: That'st he one

<dael> tantek: They think it's bad idea

<dael> smfr: And WK agrees

<dael> tantek: So it's bad design not neglect?

<dael> florian: Both.

<dael> tantek: Can't be both

<dael> Rossen_: Let's try to resolve on this. tantek do you object to the resolution? If you object let's record it and move on.

<dael> tantek: I can't find a reason to object

<dael> RESOLVED: Remove @viewport, retire the spec, move the meta tag to a new spec (CSS Viewport)

<dael> florian: And make smfr an editor of that

<dael> smfr: Okay with that

<dael> smfr: Also okay with layout and visual viewports being in this new spec

<dbaron> I'm not sure what I think about the objection of being preloader-hostile -- I think many good features may not fit nicely with preloading but that doesn't mean we shouldn't do them for other reasons.

<dael> Rossen_: Prop: Move layout visual viewport spec into CSS Viewport Spec

<dael> RESOLVED: Move layout visual viewport spec into CSS Viewport spec

<dael> smfr: Viewport or Viewports?

<smfr> “viewport” or “viewports”?

<dael> TabAtkins: Prefer singular. Maybe only have one plural in backgrounds

<dael> smfr: Fine

<fantasai> +1 to css-viewport

<dael> Rossen_: Let's stick singular for now

  • RESOLVED: Remove @viewport, retire the spec,
    move the meta tag to a new spec (CSS Viewport)

There are 2 tests specifically testing @viewport :
http://wpt.live/css/css-values/vh-support-atviewport.html
http://wpt.live/css/css-device-adapt/idlharness.html
Should we remove such tests?

Yes.

My assumptions on what we need to do with publishing and process for all of this

  • Create an ED of css-viewport
  • Get a resolution on FWPD of css-viewport
  • Get a resolution on publishing css-device-adaptation as a NOTE

I think it would be best if the publishing all happened at once, with something in the NOTE version of css-device-adaptation pointing to the new module.

Hi folks! Do you still plan to remove @viewport from the spec? I'd like to update the compatibility data on MDN to reflect the state of this feature. Having it definitively removed or knowing that it's unlikely to happen soon would be helpful for that. Thank you!

@ddbeck per https://github.com/w3c/csswg-drafts/issues/4766#issuecomment-585314599:

RESOLVED: Remove @viewport, retire the spec, move the meta tag to a new spec (CSS Viewport)

My assumptions on what we need to do with publishing and process for all of this

* Create an ED of css-viewport

@astearns do you know if it has been started?

I expect not. @smfr, am I wrong?

I have an early draft which I have not pushed yet.

There are a number of useful things that @viewport does/did that the meta viewport doesn't do, so it would probably be good to set up an explainer somewhere to preserve those, in the hope that we'll get back to this some day, but the current state of affairs doesn't help anyone.

I also hope so. meta viewport doesn't make much sense. Letting HTML tags care about layout doesn't meet the fundamental principle of HTML. This should return to CSS someday.

Is there any plan to make a similar feature come back to CSS in the near future?

Was this page helpful?
0 / 5 - 0 ratings