New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 332794 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2014
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Unknown data in <meta name="viewport" content=""> content attribute triggers console errors

Reported by peola...@gmail.com, Jan 9 2014

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36

Steps to reproduce the problem:
1. Create a webpage, like <!doctype html><title>foo</title><meta name="viewport" content="width=device-width">
2. Add an unknown value (to Chrome) in the content attribute, like minimum-ui: content="width=device-width,minimum-ui"
3. Reload the page, an error shows up in DevTools

What is the expected behavior?
No errors in the DevTools console.

What went wrong?
Error in DevTools console, but nothing is broken.

Did this work before? N/A 

Chrome version: 31.0.1650.63  Channel: stable
OS Version: OS X 10.9.1
Flash Version: Shockwave Flash 11.9 r900

There are two ways that would work much better:

1) silently ignore the value; or
2) trigger a console warning (not an error).

From what I can tell from the specification, there are no requirements to hint to the developer that a value couldn't be recognised. However, there could be value for the developer to know when a recognised _key_ inside a content attribute has an invalid value (like content="width=foo").

The specification I looked at was: http://www.w3.org/TR/css-device-adapt/#viewport-meta-element
 
Status: WontFix
Chrome does not know these properties, hence it does not know if it renders everything properly. Hence that is an error.

Comment 2 by peola...@gmail.com, Jan 9 2014

So it _assumes_ it's an error instead of a warning? I don't necessarily agree with that.

There are lots of other things the browser gracefully "recover" from without notifying the user/developer.
A little background on what motivated this ticket:

iOS added a minimal-ui viewport attribute. It's unspecified unfortunately.

* https://github.com/h5bp/html5-boilerplate/pull/1485#issuecomment-30691417
* https://github.com/WebKit/webkit/blob/master/Source/WebCore/dom/ViewportArguments.cpp#L410
* https://github.com/WebKit/webkit/commit/252c4097640c8ffbd62145f9b1e97707378f37c2#diff-a4b7879d0098ed242edad6f954275944R410

Outside of this ticket, here's some concern on the forums about our errors:
* http://productforums.google.com/forum/#!topic/chrome/OjbjXxNJPFI

We need to take console spam seriously. It muddies the experience of using the devtools. And while the rest of Chrome can spit into the console, we own the experience.

This situation here is equivalent to the CSS warnings we had barfing on syntax hacks. We either need to loosen the strictness of the viewport validation or remove it.
Owner: apavlov@chromium.org
Status: Assigned
Thanks for the broader context, Paul. Do you think won't be able to manage it and we should mute it altogether (as with CSS), or we could whitelist compatibility attributes only?
There are no tooling for the meta tags and I have seen people write the arguments wrong multiple times so I think the warnings are useful.

That said, I think we should not warn for known (even if unsupported) tags
Status: Fixed
"minimal-ui" is ignored, other errors have been turned into warnings.

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164872
Project Member

Comment 7 by bugdroid1@chromium.org, Jan 10 2014

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=164872

------------------------------------------------------------------------
r164872 | apavlov@chromium.org | 2014-01-10T13:14:41.961789Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/web/tests/ViewportTest.cpp?r1=164872&r2=164871&pathrev=164872
   A http://src.chromium.org/viewvc/blink/trunk/Source/web/tests/data/viewport/viewport-warnings-7.html?r1=164872&r2=164871&pathrev=164872
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLMetaElement-in.cpp?r1=164872&r2=164871&pathrev=164872

Reduce viewport arguments parsing noise in the DevTools console

The "minimal-ui" argument is ignored, the other parsing errors
have been transformed into warnings.

R=kenneth.r.christiansen@intel.com, pfeldman@chromium.org
BUG= 332794 

Review URL: https://codereview.chromium.org/133673002
------------------------------------------------------------------------
Looks good, guys.

error->warning is ideal. And I like keeping the viewport warnings in general. It helps.

Thx!

Sign in to add a comment