Bug 40204 - Need to recognize ";" as separator for arguments of viewport tag
Summary: Need to recognize ";" as separator for arguments of viewport tag
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-05 02:22 PDT by Gyuyoung Kim
Modified: 2011-03-08 17:24 PST (History)
6 users (show)

See Also:


Attachments
patch-1 (1.32 KB, patch)
2010-06-05 02:27 PDT, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
Proposed Patch (2.44 KB, patch)
2011-03-06 17:48 PST, Gyuyoung Kim
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gyuyoung Kim 2010-06-05 02:22:16 PDT
When arguments of viewport's tag are processed, ";" is not recognized as separator as below,

static bool isSeparator(UChar c)
{
    return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '=' || c == ',' || c == '\0';
}

However, some website is using ";" as separator.
For example, in http://m.flickr.com/#/home, it is using ";" for arguments of viewport as below,
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">

So, the "device-width;" argument is not processed by processArguments() function because the "deveice-width;" contains ";".
In my opinion, we need to add ";" to isSeparator() as below,

static bool isSeparator(UChar c)
{
    return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '=' || c == ',' || c == '\0' || c == ';';
}

If there are better solutions, please let me know.
Comment 1 Gyuyoung Kim 2010-06-05 02:27:05 PDT
Created attachment 57963 [details]
patch-1

Please review a patch attached.
Comment 2 Peter Beverloo 2010-06-06 06:02:00 PDT
After doing some quick research, the Safari documentation[1] clearly demonstrates that multiple tags should be divided by commas instead of semicolons. Other websites, including some Opera's introduction about the viewport meta[2] and a fair amount of other websites describing the possibility, talk solely about dividing by commas as well. The CSS3 Media Queries spec[3], which certainly has some similarities with viewport, does not list a semicolon in its syntax either.

Are you sure a change like this is desirable? A much easier solution probably is asking Flickr to fix their meta-tag.

[1] http://developer.apple.com/safari/library/documentation/appleapplications/reference/safarihtmlref/articles/metatags.html#//apple_ref/html/const/viewport
[2] http://dev.opera.com/articles/view/opera-mobile-9-5-the-developer-angle/
[3] http://www.w3.org/TR/css3-mediaqueries/#syntax
Comment 3 Gyuyoung Kim 2010-06-06 17:16:41 PDT
Thank you for your your opinion. It seems I need to investigate this specification further.
Comment 4 Viatcheslav Ostapenko 2011-01-07 13:55:50 PST
(In reply to comment #2)
> After doing some quick research, the Safari documentation[1] clearly demonstrates that multiple tags should be divided by commas instead of semicolons. Other websites, including some Opera's introduction about the viewport meta[2] and a fair amount of other websites describing the possibility, talk solely about dividing by commas as well. The CSS3 Media Queries spec[3], which certainly has some similarities with viewport, does not list a semicolon in its syntax either.
> 
> Are you sure a change like this is desirable? A much easier solution probably is asking Flickr to fix their meta-tag.
> 
> [1] http://developer.apple.com/safari/library/documentation/appleapplications/reference/safarihtmlref/articles/metatags.html#//apple_ref/html/const/viewport
> [2] http://dev.opera.com/articles/view/opera-mobile-9-5-the-developer-angle/
> [3] http://www.w3.org/TR/css3-mediaqueries/#syntax

That's all true, but iphone-4 and android both support comma and semicolon for viewport tag separator. It seems also, that android support space as separator also, but iphone-4 doesn't.
Comment 5 mike.zraly 2011-01-10 11:51:56 PST
The patch is not quite complete.  In addition to modifying isSeparator() it should also modify two lines in the function that calls isSeparator(), Document::processArguments(), to replace

if (buffer[i] == ',' || i >= length)

with

if (buffer[i] == ',' || buffer[i] == ';' || i >= length)
Comment 6 Gyuyoung Kim 2011-03-06 17:48:52 PST
Created attachment 84902 [details]
Proposed Patch

Thank you for your comment. I add ';' to the two lines. Iphone and Android already support semicolon as separator, I think we can add semicolon to separator. I add comments to this patch.
Comment 7 Kenneth Rohde Christiansen 2011-03-08 00:52:02 PST
Android has removed support for ; and iOS does not support it. What iOS (and WebKit trunk now) supports is trailing garbage. ie the ; in

width = 230;

is considered garbage and thus ignored. This means that width will indeed become 230.

Closing as wontfix.
Comment 8 Eric Seidel (no email) 2011-03-08 09:52:43 PST
Comment on attachment 84902 [details]
Proposed Patch

Cleared review? from attachment 84902 [details] so that this bug does not appear in http://webkit.org/pending-review.  If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).
Comment 9 Gyuyoung Kim 2011-03-08 17:24:25 PST
(In reply to comment #8)
> (From update of attachment 84902 [details])
> Cleared review? from attachment 84902 [details] so that this bug does not appear in http://webkit.org/pending-review.  If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).

Kenneth said we don't need this patch. Do you think this patch can be needed ?