This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 7916 - Strange behavior when validating optgroups
Summary: Strange behavior when validating optgroups
Status: RESOLVED INVALID
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: 0.8.5
Hardware: PC Windows XP
: P2 major
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL: http://auto.yandex.ru/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-14 10:30 UTC by Alex Rybakov
Modified: 2009-11-05 22:50 UTC (History)
1 user (show)

See Also:


Attachments

Description Alex Rybakov 2009-10-14 10:30:22 UTC
I validate url http://auto.yandex.ru/.
Look what I got.

When validating by direct input (http://validator.w3.org/#validate_by_input):
This document was successfully checked as XHTML 1.0 Transitional!
Result: 	Passed, 1 warning(s)
(Info Using Direct Input mode: UTF-8 character encoding assumed)

When validationg by URI (http://validator.w3.org/#validate_by_uri)
Error found while checking this document as XHTML 1.0 Transitional!
Result: 	1 Error 
Error  Line 13, Column 30942: end tag for "optgroup" which is not finished
oup label="îòå÷åñòâåííûå"></optgroup><optgroup label="èíîìàðêè"><option value


This optgroup isn't empty.
<optgroup label="îòå÷åñòâåííûå"><option value="VAZ">LADA (ÂÀÇ)</option><option value="GAZ">ÃÀÇ</option><option value="ZAZ">ÇÀÇ</option><option value="ZIL">ÇÈË</option><option value="IG">ÈÆ</option><option value="KAMAZ">ÊÀÌÀÇ</option><option value="LUAZ">ËÓÀÇ</option><option value="MOSCVICH">Ìîñêâè÷</option><option value="SEAZ">ÑåÀÇ</option><option value="TAGAZ">ÒàãÀÇ</option><option value="UAZ">ÓÀÇ</option></optgroup>


Do you have any idea how to fix it?
Comment 1 Alex Rybakov 2009-11-05 17:20:38 UTC
Anybody here?
Comment 2 Ville Skyttä 2009-11-05 19:39:07 UTC
Validator does validate what it receives, and when validating by URI, there *is* an empty optgroup, you can verify it with the "Show source" option:
<optgroup label="&#1086;&#1090;&#1077;&#1095;&#1077;&#1089;&#1090;&#1074;&#1077;&#1085;&#1085;&#1099;&#1077;"></optgroup>

When I load the site in Firefox, the empty optgroup is not there, so the target site probably serves different versions to different user agents depending on some criteria, and perhaps you used code retrieved by a browser that didn't receive the empty optgroup when validating by direct input.
Comment 3 Alex Rybakov 2009-11-05 20:14:44 UTC
(In reply to comment #2)
> Validator does validate what it receives, and when validating by URI, there
> *is* an empty optgroup, you can verify it with the "Show source" option:
> <optgroup
> label="&#1086;&#1090;&#1077;&#1095;&#1077;&#1089;&#1090;&#1074;&#1077;&#1085;&#1085;&#1099;&#1077;"></optgroup>
> 
> When I load the site in Firefox, the empty optgroup is not there, so the target
> site probably serves different versions to different user agents depending on
> some criteria, and perhaps you used code retrieved by a browser that didn't
> receive the empty optgroup when validating by direct input.
> 

Yeah, I looked at "View Source" in IE and all optgroups are indeed empty. Will fix it and response.
Comment 4 Alex Rybakov 2009-11-05 20:19:18 UTC
No, I'm mistaken.

IE (7) View Source validates properly and optgroup isn't empty.
So as in Opera's.

And I can say that the server doesn't serve different data to different user agents.
Comment 5 Ville Skyttä 2009-11-05 21:04:48 UTC
(In reply to comment #4)
> And I can say that the server doesn't serve different data to different user
> agents.

Well, something does cause them to be very different for example for the production version of the validator and the development one, compare the source listings.  Here's what I see right now:

http://validator.w3.org/check?uri=http%3A%2F%2Fauto.yandex.ru%2F;ss=1
* The first optgroup is empty
* The second optgroup has options Audi, BMW, Cadillac, ...

http://qa-dev.w3.org/wmvs/HEAD/check?uri=http%3A%2F%2Fauto.yandex.ru%2F;ss=1
* The first optgroup has options LADA, GAZ, ERAZ, ...
* The second optgroup has options AC, ACURA, ALFA_ROMEO, ALPINA, ...

Perhaps the site serves different versions based on where it is fetched (GeoIP or something?).  There's still no evidence that this would be a validator problem (it correctly marks the empty optgroup as invalid), so re-closing as invalid.
Comment 6 Alex Rybakov 2009-11-05 22:50:45 UTC
Hmm. Geo targeting is possible.
Can you tell me what region your dev and stable versions are? If it's an open info.