W3C

Edit comment LC-1648 for Mobile Web Best Practices Working Group

Quick access to

Previous: LC-1626 Next: LC-1616

Comment LC-1648
:
Commenter: Bert Bos <bert@w3.org> on behalf of CSS Working Group

or
Resolution status:

"If the Internet media type is "text/css" and the content is not
well-formed CSS (contains mismatching brackets or illegal
characters), FAIL" should probably be rewritten, because CSS doesn't
define the term "well-formed."

But it is not immediately clear what it should be rewritten as. The
CSS spec is written to (1) allow future extensions and (2) to make
the meaning well-defined for as large a set of inputs as possible. A
visual UA will ignore the (legal) 'cue' property the same way it
ignores the (misspelled) 'magrin' property. There is no need for CSS
to say that one is legal and the other an error.

Illegal characters and unparsable input are explicitly undefined in
CSS, so there is no doubt that those must not be "mobileOK." On the
other hand, the handling of unbalanced parentheses *is*
well-defined. Informally, the wording suggests that unbalanced
parentheses are worse errors than unknown properties, but in the
spec they are handled the same way, viz., with rules to throw away
parsed tokens.

Maybe: "If [...] content triggers at least one CSS parsing error as
defined in the CSS specification, FAIL."

CSS 2.1 has a section 4.2 called "parsing errors," but there are
errors defined in other sections, too. CSS 2.1 section 4.2 has this:

- Unknown properties
- Illegal values
- Malformed declarations
- Invalid at-keywords (*)
- Unexpected end of style sheet
- Unexpected end of string
- (by reference to 4.1.7:) Invalid selector

(* already separated out in MobileOK section 3.22)

Other errors are defined in section 4.1:

- Input that cannot be tokenized or parsed (section 4.1.1)
- Vendor-specific extensions (4.1.2.1)
- U+0 character (4.1.3)
- Non-Unicode characters (4.1.3)

For example, a style sheet that consists of just this

;;;

cannot be parsed.
(space separated ids)
(Please make sure the resolution is adapted for public consumption)


Developed and maintained by Dominique Hazaël-Massieux (dom@w3.org).
$Id: 1648.html,v 1.1 2017/08/11 06:43:33 dom Exp $
Please send bug reports and request for enhancements to w3t-sys.org