State of the Browsers

Similar documents
Web standards and IE8

Hell is other browsers - Sartre. The touch events. Peter-Paul Koch (ppk) WebExpo, 24 September 2010

<layer> or the ingrained habits of web development. Peter-Paul Koch HTML Special, 16 June 2016

Viewports. Peter-Paul Koch DevReach, 13 November 2017

Hell is other browsers - Sartre. The touch events. Peter-Paul Koch (ppk) DIBI, 28 April 2010

Understanding Browsers

Hell is other browsers - Sartre. Ajax Workshop. Peter-Paul Koch (ppk) Fundamentos del Web, 28 October 2008

How to clear a web browsers cache, cookies and history last updated on 8/28/2013

Delete Cookies Windows 7 Internet Explorer 10

Changing The User Agent String In Safari User Guide For Web Developers

Browser Bugs & Validation

ADDING FUNCTIONS TO WEBSITE

Chrome if I want to. What that should do, is have my specifications run against four different instances of Chrome, in parallel.

E-statement Settings Guide


Browser Wars : Battles of Standards

Blog post on updates yesterday and today:

A Double Edged Sword. December 10, Originally published March 15, 1996 in Web Review magazine.

Part of this connection identifies how the response can / should be provided to the client code via the use of a callback routine.

Who is Mozilla? What is Firefox? Is it better than Internet Explorer? Presented by Phil Goff (Branch 116) September 18, 2008

Choosing the web s future. Peter-Paul Koch Van Lanschot, 9 February 2017

The plural of Chromium is Chromia. Peter-Paul Koch Mobilism, 27 March 2015


The plural of Chromium is Chromia. Peter-Paul Koch NLHTML5 Rotterdam, 19 February 2015

Instructions For Configuring Your Browser Settings and Online Banking FAQ's

Lecture6. This lecture we will study about last window object which is navigator object.

What is a web browser?

Does mozilla firefox support windows 10

How To Install Flash Firefox Android Tablet Os On Hp

A pixel is not a pixel. Peter-Paul Koch BlackBerry Jam, 6 February 2012

Web browser architecture

Get ready for mycourses

NACStat FAQ s Background Table of Contents

HTML5 MOCK TEST HTML5 MOCK TEST I

Create web pages in HTML with a text editor, following the rules of XHTML syntax and using appropriate HTML tags Create a web page that includes

HTML/CSS Essentials. Day Three Ed Crowley

Below you'll find some browser and device specific instructions, as well as links to more expansive tutorials if you need them.

Browsers form the Web's user interface, with web versions of everything graphical. Browsers Tag Soup HTML Development

PROFESSOR: Last time, we took a look at an explicit control evaluator for Lisp, and that bridged the gap between

Digital Marketing Manager, Marketing Manager, Agency Owner. Bachelors in Marketing, Advertising, Communications, or equivalent experience

Instructions for Configuring Your Browser Settings and Online Security FAQ s


Next... Next... Handling the past What s next - standards and browsers What s next - applications and technology

INTRODUCTION TO HTML5! HTML5 Page Structure!

Browser Cookie Settings

Introduction to JavaScript and the Web

Windows 7 Will Not Load On My Computer Says I'm

Lesson 1 using Dreamweaver CS3. To get started on your web page select the link below and copy (Save Picture As) the images to your image folder.

Viewports. Peter-Paul Koch CSS Day, 4 June 2014

MITOCW watch?v=w_-sx4vr53m

8.0 Help for End Users About Jive for SharePoint System Requirements Using Jive for SharePoint... 6

Web Design and Development ACS-1809

How to approach the web platforms. Peter-Paul Koch Nordic Competence Conference, 12 September 2015

How To Delete Cookies In Vista Firefox Windows 7 Google Chrome

Step 4 Part F - How to Download a Video on YouTube and Delete a Video

Install Flash Plugin Manually Internet Explorer 9 Webm

A lot of people make repeated mistakes of not calling their functions and getting errors. Make sure you're calling your functions.

Opera Mini Manual For Android Tablet Internet

Release Notes OGantt version Bug Fixes 29 JUN :10 ID : 671 Fixed in version : 3.8.0

More CSS goodness with CSS3. Webpage Design

Why is firefox using bing

PROJECT SUMMARY Our group has chosen to conduct a usability study over

Autodesk University Step Up Your Game AutoCAD P&ID and SQL: Making Data Work for You Skill Level: All Levels

Css Pdf Reader Software For Windows 7 64 Bit

1 Introduction. 2 Web Architecture

Web Architecture Review Sheet

In today s video I'm going show you how you can set up your own online business using marketing and affiliate marketing.

Browser Support Internet Explorer

CSCI 1320 Creating Modern Web Applications

Subversion was not there a minute ago. Then I went through a couple of menus and eventually it showed up. Why is it there sometimes and sometimes not?

Introduction to JavaScript p. 1 JavaScript Myths p. 2 Versions of JavaScript p. 2 Client-Side JavaScript p. 3 JavaScript in Other Contexts p.

Big Data Analytics In M2M Open Source Editors Formatting Issues

The mobile browser world. Peter-Paul Koch Front-end Day workshop, 26 April 2011

Version Developed & Programmed by Ryan Stevenson. Plugin Support:

Live Guide Co-browsing

5/19/2015. Objectives. JavaScript, Sixth Edition. Introduction to the World Wide Web (cont d.) Introduction to the World Wide Web

webdriver selenium 08FE064A22BF82F5A04B63153DCF68BB Webdriver Selenium 1 / 6

A PROGRAM IS A SEQUENCE of instructions that a computer can execute to

INCOGNITO TOOLKIT: TOOLS, APPS, AND CREATIVE METHODS FOR REMAINING ANONYMOUS, PRIVATE, AND SECURE WHILE COMMUNICATING, PUBLISHING, BUYING,

Apple Mighty Mouse Windows 7 Pairing Code

DoNotCall.gov: Do Not Call it up With Firefox

Put a UI Developer in a Bank. See what happens

Online Access: Login to The Media Audit

Why You Should Not Use Arch

Post Experiment Interview Questions

MITOCW watch?v=penh4mv5gag

iphone ios 8.x (4s, 5, 5s & 5c, 6, 6+ models) ipad ios 8.x (all models) Android OS or higher

Adobe Flash Player Manual Firefox Mozilla Opera Chrome) 32-bit

Content Security Policy

World Wide Web. World Wide Web - how it works. WWW usage requires a combination of standards and protocols DHCP TCP/IP DNS HTTP HTML MIME

It Might Be Valid, But It's Still Wrong Paul Maskens and Andy Kramek

CSI 3140 WWW Structures, Techniques and Standards. Browsers and the DOM

Types of style sheets

Creating a Bookmark/Link for the Portal(my.cuw.edu)

Languages in WEB. E-Business Technologies. Summer Semester Submitted to. Prof. Dr. Eduard Heindl. Prepared by

FIREFOX MENU REFERENCE This menu reference is available in a prettier format at

Manually Clear Chrome Cache Mac Os X Mountain Lion

MITOCW watch?v=se4p7ivcune

PCC Local File Viewer User Guide. Version /23/2015 Copyright 2015

Free Web Development Tools: The Accessibility Toolbar

Transcription:

Hell is other browsers - Sartre State of the Browsers Peter-Paul Koch (ppk) http://quirksmode.org http://twitter.com/ppk The Ajax Experience, Sept. 30, 2008

quirksmode.org

Today's topics I'm not going to discuss many browser incompatibilities. That means that your favorite bug will not be treated. Sorry.

Today's topics - A bit of history - Compatibility patterns, with examples - Browser detects and how to do them right - A peek into the future

A bit of history

The browser market long ago IE NN Opera

Browser Wars, 1996-1999

Browser Wars Era A world divided - Netscape Navigator - MS Internet Explorer and they were incompatible.

And when I say incompatible I mean really, deliberately document.layers incompatible document.all

Browser Wars Era - Deliberate incompatibilities Why? To leverage their competitor out of the market.

Browser Wars Era - Deliberate incompatibilities That didn't work. Why not?

Users don't care which browser they're using. If a site doesn't work they blame the site owner. Whether that's fair or not.

Browser Wars Era - Deliberate incompatibilities

Browser Wars Era - Deliberate incompatibilities - Ideological in nature Microsoft is Evil. Why? Well, just because.

Browser Wars Era - Deliberate incompatibilities - Ideological in nature - Influence of web devs: zero

Let's hope this works... - some web dev guy

Nope.

Browser Wars Era - Deliberate incompatibilities - Ideological in nature - Influence of web devs: zero Why? Because they were supposed to choose sides and shut up.

Browser Wars Era - Deliberate incompatibilities - Ideological in nature - Influence of web devs: zero But that didn't work because users don't care which browser they're using.

Browser Wars Era - Deliberate incompatibilities - Ideological in nature - Influence of web devs: zero

Until...

Until...

Browser Peace IE 5.0 Windows was the first browser to decently support the W3C DOM. And IE5 Mac did the same for CSS1. Back then, Microsoft deserved to win.

The browser market back then IE NN4 Opera

Browser Peace 1999-2008? Although Microsoft deserved to win back in 1999, it became complacent and didn't do anything for the next six years. Other browsers profited from that.

Today's browsers - IE 7 - Firefox 3.0 - Safari 3.1 - Opera 9.5 - Chrome 0.2

When IE gets it wrong

When IE gets it wrong <sigh /> The good news: Microsoft is actually working on it.

Adding rules to style sheets stylesheet.insertrule(...);

Adding rules to style sheets stylesheet.addrule(...); Fortunately, this is easily solved.

Adding rules to style sheets if (stylesheet.insertrule) { stylesheet.insertrule(...); } else if (stylesheet.addrule) { stylesheet.addrule(...); }

Compatibility patterns #1 IE uses a different name for essentially the same functionality. A simple code branch solves this problem.

Event registration element.addeventlistener ('click',somefn,false);

Event registration element.attachevent('onclick',somefn);

Compatibility patterns #2 Minor browsers sometimes have to support major browsers' proprietary stuff.

Event registration element.attachevent('onclick',somefn) function somefn() { this.style.backgroundcolor = '#ffffff'; }

Event registration element.attachevent('onclick',somefn) function somefn() { this.style.backgroundcolor = '#ffffff'; } You expect this to refer to the clicked element.

Event registration element.attachevent('onclick',somefn) function somefn() { this.style.backgroundcolor = '#ffffff'; } Unfortunately this refers to the window. Except in Opera.

Event registration In other words: Opera is not buggy enough. (Plz fix. Thx.)

Compatibility patterns #2b Minor browsers sometimes have to support major browsers' proprietary stuff and copy their bugs

Ranges <body> <blockquote> Web developers! Web developers! Web developers! </blockquote> <cite>steve Ballmer</cite> </body>

Ranges <body> <blockquote> Web developers! Web developers! Web developers! </blockquote> <cite>steve Ballmer</cite> </body>

Ranges <body> <blockquote> Web developers! Web developers! Web developers! </blockquote> <cite>steve Ballmer</cite> </body> In which nodes does the selection start and end?

Ranges In which nodes does the selection start and end? range.startcontainer range.endcontainer

Ranges In which nodes does the selection start and end? Not possible in IE. (Well, OK, you could parse the HTML to search for the selection.) (Have fun.)

Compatibility patterns #3 Sometimes browsers just don't support stuff at all. Can't be helped except by pressuring them.

When IE gets it right

Compatibility patterns The difference between extensions and incompatibilities.

When IE gets it right Microsoft extensions. 99% are boring or useless 1% are stunningly brilliant

When IE gets it right Brilliant Microsoft extensions - :hover - innerhtml Let's review a few more.

Empty text nodes <body> <blockquote> Web developers! Web developers! Web developers! </blockquote> <cite>steve Ballmer</cite> </body> How many children does the body have?

Empty text nodes <body> One child <blockquote> Two Web children developers! Web developers! Web developers! Three children </blockquote> Four children <cite>steve Ballmer</cite> Five children </body> How many children does the body have?

Empty text nodes <body> One child <blockquote> Two Web children developers! Web developers! Web developers! Three children </blockquote> Four children <cite>steve Ballmer</cite> Five children </body> How many children does the body have?

Empty text nodes The first child is not the blockquote <body> <blockquote> Web developers! Web developers! Web developers! </blockquote> <cite>steve Ballmer</cite> </body>

Empty text nodes but the whitespace between body and blockquote <body>......<blockquote> Web developers! Web developers! Web developers! </blockquote> <cite>steve Ballmer</cite> </body>

Empty text nodes and yes, that's totally absurd. Whitespace is unimportant in HTML. <body>......<blockquote> Web developers! Web developers! Web developers! </blockquote> <cite>steve Ballmer</cite> </body>

Empty text nodes Fortunately IE gets it right. The body has two children: the blockquote and the cite <body> 1) <blockquote> Web developers! Web developers! Web developers! </blockquote> 2)<cite>Steve Ballmer</cite> </body>

Empty text nodes Everybody gets it wrong. Except for IE.

Compatibility patterns #4 Deliberate incompatibilities are wrong except when you're right.

Dropdown menu You want to know when the mouse exits the opened submenu.

Dropdown menu a.onmouseout a.onmouseover a.onmouseout a.onmouseover a.onmouseout a.onmouseover a.onmouseout

Dropdown menu a.onmouseout a.onmouseover a.onmouseout a.onmouseover a.onmouseout a.onmouseover a.onmouseout Lots of stuff! Fun! But has the mouse left the submenu yet?

Dropdown menu Mouseover and mouseout aren't very developer-friendly. That's why IE added mouseenter and mouseleave.

Dropdown menu You want to know when the mouse exits the opened submenu.

Dropdown menu ul.onmouseenter ul.onmouseleave... that's it

Dropdown menu works better with mouseenter and mouseleave. IE-only.

Compatibility patterns #5 This is a proprietary extension. A way of saying We think this is a good idea If other browser vendors agree, it might become part of the standard

When FF gets it wrong

When FF gets it wrong (or at least ignores common sense) There are a few methods and properties that are not defined in the spec but are nonetheless so totally useful that all browsers support them. Except for Firefox.

children <body> <blockquote> Web developers! Web developers! Web developers! </blockquote> <cite>steve Ballmer</cite> </body>

children Five children document.body.childnodes[] -> 5 elements But we're usually interested only in the children that are elements.

children Five children, two of which are elements document.body.children[] -> 2 elements The blockquote and the cite. Just what we need

contains a.onmouseout a.onmouseover a.onmouseout a.onmouseover a.onmouseout a.onmouseover a.onmouseout

contains Does the currently opened layer contain the element the user moused to? If No, the layer should close.

contains Does the currently opened layer contain the element the user moused to? if (!current.contains(related)) { current.close(); }

contains Does the currently opened layer contain the element the user moused to? if (!current.contains(related)) { current.close(); }

Compatibility patterns #5b These are also proprietary extensions. If they're a really good idea, all browsers should support them. (And FF 3.1 is.)

Compatibility patterns IE is not the only browser to refuse to support useful stuff for years on end.

Browser incompatibilities will remain a fact of life for the near future. That means we need to know which browsers visit our sites.

Browser detects are evil most of the time (you knew that, didn't you?)

Browser detects 1) To gather stats about browser use on your site. 2) To take application decisions.

Browser detects 1) To gather stats about browser use on your site. GOOD. 2) To take application decisions.

Browser detects 1) To gather stats about browser use on your site. 2) To take application decisions. EVIL (most of the time)

The problem Once upon a time there were Mosaic and Netscape. Now Netscape could do nifty stuff. - cookies - <center>

The problem Once upon a time there were Mosaic and Netscape. Both sent a useragent HTTP header back to the server. (JavaScript: navigator.useragent)

The problem <% if useragent.contains('mozilla') %> <H1> <CENTER> Hello, <% cookie.name %>! </H1> </CENTER> <% else %> <H1> You're really UNCOOL, you know? </H1> <% endif %>

The problem Then came IE It wanted to end up on the right side of those browser detects. Mozilla/3.0 (compatible; MSIE yadda yadda yadda)

The problem Then came IE It wanted to end up on the right side of those browser detects. Mozilla/3.0 (compatible; MSIE yadda yadda yadda) It disguised itself as Netscape.

By the time the Browser Wars ended

By the time the the Browser Wars ended many web developers had decided to support only IE. In retrospect, a sensible decision, given its market share and development ease.

By the time the the Browser Wars ended many web developers had decided to support only IE. if (useragent.contains('msie')) { <H1>Welcome</H1> } else { redirect('wrongbrowser.html') }

But Opera could handle most of those sites So what did Opera do? It hid its identity. (More correctly: it allowed users to select a different identity.)

Identify as Opera: Opera/9.26 (Windows NT 5.1; U; en) Identify as IE: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.26 Mask as IE: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en)

Identify as Opera: Opera/9.26 (Windows NT 5.1; U; en) Identify as IE: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.26 Mask as IE: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en)...

Browser detects Browsers commonly lie about their identity in order to bypass browser detects written by clueless web developers That's OUR fault.

Browser detects Browsers commonly lie about their identity navigator.useragent is unreliable in order to bypass browser detects written by clueless web developers That's OUR fault.

Doing it right 1) Use a property meant for identification such as window.opera or IE conditional comments

Doing it right 1) Use a property meant for identification 2) Use navigator.vendor It does not lie. Yet.

Doing it right 1) Use a property meant for identification 2) Use navigator.vendor 3) Use navigator.useragent and first detect the minor browsers Resolve FF/IE only when you're certain that it's no other browser

Doing it right 1) Use a property meant for identification 2) Use navigator.vendor 3) Use navigator.useragent

Doing it right 1) Use a property meant for identification 2) Use navigator.vendor 3) Use navigator.useragent The first two steps can only be done in JavaScript.

Doing it right 1) Use a property meant for identification 2) Use navigator.vendor A JavaScript browser detect is more trustworthy than a server side one.

What's next? IE, Firefox, Safari, Opera Now Chrome A shake-up is inevitable.

Browser Wars II, 2008-?

A world divided? - Deliberate incompatibilities - Ideological in nature - Influence of web devs: zero

A world divided? - Deliberate incompatibilities - Ideological in nature - Influence of web devs: zero

A world divided? - Deliberate incompatibilities - Ideological in nature - Influence of web devs: some

A world divided? - Deliberate incompatibilities - Ideological in nature - Influence of web devs: some

Ideology Microsoft is Evil. Yawn.

Go to war again? To defeat the Evil Empire?

Go to war again? Or to gain status and nice medals?

Or maybe... not go to war at all...?

Go to war again? The only reason would be to influence changes in the browser market. But can we? And if we can, should we?

The current browser market IE Chrome FF Safari Opera

The future browser market? IE Chrome FF Safari Opera

New fronts: Mobile

New fronts: Mobile iphone Opera Mini Opera Mobile Windows Mobile Google Android...

New fronts: Mobile Will browser quality play a role in consumers' choice for a mobile device? I doubt it.

A quote from Nate Koechley Why do we need more than one browser? Seriously, though.

Why do we need more than one browser? Our answer: Competition, which fosters innovation.

Competition, which fosters innovation. Is that good enough? Good enough to force countless web developers to spend thousands of hours on solving browser incompatibilities?

Why do we need more than one browser? If you have an answer, let me know.

To wrap it up Browsers will continue to move towards each other in terms of compatibility. The browser market is going to change rapidly over the next year or so. Maybe there'll be another browser war. I hope not, though.

Thank you

Questions?