Bug 20766 - @lang on <html> seen as invalid if MIME = application/xhtml+xml, preset = HTML5 and parser = XML.
Summary: @lang on <html> seen as invalid if MIME = application/xhtml+xml, preset = HTM...
Status: NEW
Alias: None
Product: HTML Checker
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael[tm] Smith
QA Contact: qa-dev tracking
Depends on:
Blocks: 20783
  Show dependency treegraph
Reported: 2013-01-25 01:21 UTC by Leif Halvard Silli
Modified: 2013-01-26 13:40 UTC (History)
1 user (show)

See Also:

Screenshot of valdiation result. (73.84 KB, image/png)
2013-01-25 01:21 UTC, Leif Halvard Silli
Screenshot of validation settings plus result. (71.22 KB, image/png)
2013-01-25 01:42 UTC, Leif Halvard Silli

Note You need to log in before you can comment on or make changes to this bug.
Description Leif Halvard Silli 2013-01-25 01:21:48 UTC
Created attachment 1318 [details]
Screenshot of valdiation result.

Steps to repeat:

1. Locate a page of the following characteristics:
   a. has XHTML5 markup.
   b. has both lang="foo" and xml:lang="foo" on root element
   c. has Content-Type set to application/xhtml+xml
   d. is served via HTTP or via data URI
2. Check the "Be lax about content-type" option.
2. Validated the page: http://tinyurl.com/adme4qz

(NOTE: The page is parsed as XML.)

Expected result: The lang attribute should be seen as valid.

  Actual result: Validator complains that lang is invalid.
Comment 1 Leif Halvard Silli 2013-01-25 01:40:51 UTC
Actually, the bugs has nothing to do with "lax about content-type": http://tinyurl.com/a85bg9g

Instead, it has to do with using a HTML5 preset together with the XML parser.
Comment 2 Leif Halvard Silli 2013-01-25 01:42:29 UTC
Created attachment 1319 [details]
Screenshot of validation settings plus result.
Comment 3 Leif Halvard Silli 2013-01-25 02:43:54 UTC
(1) A validation counterexample: http://tinyurl.com/bfwfjwf

    In the counter example (1), then
  * @lang has been deleted (actually: replaced with @data-lang)
  * <noscript> (which is invalid in XHTML5) has been added.
  # Result: It validates. 
  # The fact that <noscript> is accepted means (despite the weird
    non-acceptance of the @lang attribute) that it is the 
    HTML-conformance rules that are active, despite the XML parser.

(2) A counter-counterexample: http://tinyurl.com/akwuz2r

    In the counter-counterexample (2), then
  * Same code as in (1) is used, EXCEPT ...
  * … EXCEPT that there is an non-well-formed <hr>
  # Result: It doesn't validate due to the non-closed <hr>
  # The fact that it doesn't validate despite using a HTML5 preset
    is because it nevertheless is the XML parser that is used.