123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?php
- /**
- * <https://y.st./>
- * Copyright © 2017 Alex Yst <mailto:copyright@y.st>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org./licenses/>.
- **/
- $xhtml = array(
- 'title' => 'Markup validation',
- 'subtitle' => 'Written in <span title="Web Programming 1">CS 2205</span> of <a href="http://www.uopeople.edu/">University of the People</a>, finalised on 2017-09-13',
- 'copyright year' => '2017',
- 'body' => <<<END
- <p>
- The main tool I used to use for markup validation was the $a[W3C]'s <a href="https://validator.w3.org/">main validation tool</a>.
- However, that tool has some issues.
- First, it cannot load pages from servers that make use of $a[SNI].
- I'm not sure why not, as servers that support $a[SNI] tend to also accept requests without it, so it baffles me that this validation tool somehow chokes when it comes to those servers.
- Second, this tool doesn't handle $a[HTML]5 or $a[HTML] 5.1, and can only validate pages written in an older version of $a[HTML] or $a[XHTML].
- Now, I instead use their experimental <a href="https://validator.w3.org/nu/">Nu validator</a>.
- </p>
- <h2><a href="https://validator.w3.org/nu/?useragent=Validator.nu%2FLV+http%3A%2F%2Fvalidator.w3.org%2Fservices&acceptlanguage=&doc=https%3A%2F%2Fwww.uopeople.edu%2F">University of the People's website</a></h2>
- <p>
- Our university is teaching us the importance of Web standards, so you'd think their own website would pass inspection, right?
- Nope.
- Most websites aren't properly written, and University of the People's is no exception.
- </p>
- <p>
- The main error present is the lack of an <code>alt</code> attribute on several <code><img/></code> tags.
- This attribute is <strong>*mandatory*</strong> for most <code><img/></code> tags.
- I thought <strong>*all*</strong> <code><img/></code> tags required it, but according to the validator, there are some cases in which they're not needed.
- However, the missing attribute in these <code><img/></code> tags isn't one of those cases; otherwise the validator wouldn't be throwing errors.
- This is a pretty common mistake made on the Web.
- Another common theme in the error list is the presence of <code><div/></code> tags nested within <code><h1/></code> and <code><h2/></code> tags.
- <code><h1/></code> and <code><h2/></code> tags are supposed to contain inline elements, not block elements, so <code><div/></code> tags don't belong there.
- Some <code><h2/></code> tags are nested within <code><span/></code> tags as well, causing more errors.
- Like <code><h1/></code> and <code><h2/></code> tags, <code><span/></code> tags contain only inline elements.
- While <code><h1/></code> and <code><h2/></code> tags <strong>*contain*</strong> inline elements, they <strong>*are*</strong> block elements, so they don't belong within a <code><span/></code> tag.
- In general, the home page of the university shows a frequent misuse of heading tags.
- A <code><style/></code> tag is also out of place, being in the <code><body/></code> instead of the <code><head/></code>.
- The <code><meta/></code> tag has an invalid <code>content</code> attribute value, and the deprecated <code>border</code> attribute is used in a couple places.
- The validator presents a few non-error warnings worth taking into consideration as well.
- The language of the document isn't specified in the <code><html/></code> tag's <code>lang</code> attribute, the page disables user zooming, and one of the headings is empty.
- In general, this is a pretty messy page.
- I will say this though: at least the page appears to be well-formed, which I wasn't expecting.
- Tags and attributes are misused and misplaced, but there are no syntax errors.
- </p>
- <p>
- Aside from the validator errors and warnings, I'd say the main thing that doesn't work well on the page is the use of JavaScript to run the videos.
- Videos are plenty capable of running on a webpage without JavaScript, and requiring JavaScript makes the page less accessible to people with different browser set-ups.
- Other than that, the page seems to be in good working order to me.
- </p>
- <h2><a href="https://validator.w3.org/nu/?useragent=Validator.nu%2FLV+http%3A%2F%2Fvalidator.w3.org%2Fservices&acceptlanguage=&doc=http%3A%2F%2Ffloraverse.com%2F">Floraverse</a></h2>
- <p>
- Floraverse is one of two comics I read, the other being one that updates so infrequently that I never know when to expect a new page.
- I wasn't expecting it, but their markup is incredibly clean.
- They do have one reoccurring error though: missing <code>alt</code> attributes on their <code><img/></code> tags.
- Again, this is an incredibly common error and most people don't seem to realise that the <code>alt</code> attribute isn't optional, but <strong>*mandatory*</strong>.
- The validator also throws out some warnings requesting heading tags be used within the <code><section/></code> elements, but these are just very good suggestions and not requirements.
- </p>
- <p>
- The comments section doesn't function without JavaScript, though.
- This is a big accessibility problem.
- Additionally, the heavy use of images makes non-graphical browsing of the site pointless.
- That said, it's a Web comic.
- What can you expect?
- The comments section should be cleaned up, but as for the heavy image use, it's sort of the whole point of the site.
- There's no need to fix that, aside from adding <code>alt</code> attributes where they belong.
- </p>
- <h2><a href="https://validator.w3.org./nu/?useragent=Validator.nu%2FLV+http%3A%2F%2Fvalidator.w3.org%2Fservices&acceptlanguage=&doc=https%3A%2F%2Fy.st.%2F">My own website</a></h2>
- <p>
- We can't discuss website validation without considering the validation of our own websites.
- Personally, I'm a stickler for standards, and as a result, my website's markup is flawless.
- In fact, every page of my website has a link in the footer to the $a[W3C] validator with the appropriate query string to tell the validator to display the validation results for that particular page.
- The validator has neither any errors nor any warnings to present.
- </p>
- <p>
- I also do my best to make my site incredibly accessible.
- I use a very simple layout.
- There's a little JavaScript, but the site works perfectly well without it; the JavaScript's just a navigation aid, allowing the user to use the left and right arrow keys on certain pages to load the previous and next pages, respectively.
- Even if JavaScript's disabled though, it works because actual <code><a/></code> tags are provided in the navigation menu to get to both adjacent pages (in fact, the JavaScript is set up to read the $a[URI]s from those tags to know where to send the user, so the content of those tags is identical to what the user gets from the JavaScript).
- That doesn't mean my site's without issue though.
- There are at least two problems.
- Most noticeably, the site makes use of a $a[TLS] certificate issued by a certificate "authority" blacklisted by Mozilla.
- Mozilla-based browsers therefore refuse to load my website at all.
- However, I can't afford a commercial $a[TLS] certificate, so I don't have any option to replace it until I find another certificate "authority" that gives out decent and gratis certificates.
- Most browsers offer you a way to bypass the certificate issue if you choose to, but Mozilla-based browser refuse to provide this option for websites using certificates issued by my provider.
- This is a problem in Mozilla-based browsers, not my website, and there's nothing I can do about it.
- The second issue is triggered by a bug in some browsers.
- Some browsers ignore the <code>Content-Type</code> header, and in doing so, assume my pages are written in $a[HTML] of some sort.
- They're not.
- They're written in $a[XHTML] 5.1.
- When rendered as $a[HTML], my pages appear blank; they <strong>*must*</strong> be rendered in $a[XHTML] to display their content properly.
- This is an uncommon bug though, and I've only heard of it happening in old versions of the Links browser.
- Other browsers and newer versions of that browser don't have that problem.
- </p>
- END
- );
|