net - UK (2020-04)

(Antfer) #1
conservative in what you send. Be liberal
in what you accept.”
Browsers are very liberal in what they
accept when it comes to HTML. On the
one hand, this can be quite frustrating
if you’re a developer trying to isolate
a mistake in your HTML. On the other
hand, this looseness has enabled HTML
to grow over time without breaking in
older browsers.
In the first decade of the web’s life,
HTML saw an explosive growth. New
elements and attributes were added to
the language. Some of those additions
were adding new semantic granularity
but some had absolutely nothing to do
with semantics. Elements and attributes
for specifying fonts sizes, colours and
borders were introduced. HTML, which
was intended for defining document

proposal, Berners-Lee created the first
version of HTML, the first web server
and the first web browser. The browser
was somewhat confusingly named
WorldWideWeb.
Thirty years on from the original
proposal for the world wide web, a group
of designers and developers gathered
together for a week at CERN to recreate
the experience of using that first ever
web browser. You can see the final result
at worldwideweb.cern.ch.
Amazingly, you can browse websites
made today in a browser that was made
three decades ago. There won’t be any
styling. There won’t be any scripting.
Neither CSS nor JavaScript existed at the
birth of the web. But if a website has
been built in a robust way, it will still
make sense even when viewed in an
ancient web browser.

EXTENDING THE WEB
Scientific collaboration was the first
use-case for the world wide web but the
project wasn’t designed to be limited to
that usage. Berners-Lee knew that he
couldn’t predict how the web would be
used in the future. He therefore designed
it to be extensible.
The first version of the HyperText
Markup Language had just a handful of
elements. But the HTML language is open
to new elements being added. Over time,
we got more form fields, more structural
elements like section and article and
even more media like audio, video
and responsive images. None of these
additions introduced breaking changes.
That’s because of the error-handling
model of HTML.
When a web browser encounters an
HTML element it doesn’t understand,
it renders whatever is in between the
opening and closing tags. It displays
the content while ignoring the tags it
doesn’t understand. What’s interesting
here is what the browser doesn’t do.
The browser doesn’t throw an error. The
browser doesn’t stop parsing the HTML
as soon as it encounters an element that
it doesn’t understand.
This kind of lax error handling is an
example of a design principle called The
Robustness Principle or Postel’s Law: “Be

The first version


of the HyperText


Markup


Language had


just a handful of


elements. But


HTML is open to


new elements


being added


FEATURES
Connect the web’s building blocks

Free download pdf