Archive for October, 2011

File Under: Web Basics

The Future of the Web Needs to Include the Past

As much as we all love cutting edge web technologies and modern browsers running on fast hardware, sometimes it’s good to step back and remember what really makes the web great is the fact that anyone — using any browser running on any hardware — can use it. As software developer and web evangelist John Allsopp recently put it, “the power of the Web is in its universality.”

Part of that universality means making sure everyone can access the web. That’s why standards exist; why accessibility is important and planning for a future of non-PC devices is a smart move. But universality also means supporting older web browsers, less capable hardware and slower internet connections.

Allsopp’s comment about universality is part of his larger pushback against what he believes is an alarming trend — developers leveraging the latest and greatest features of a specific web browser at the expense of all the rest.

New tools are good and experiments help push the web forward, but excluding those using older browsers just because your killer design doesn’t work is a mistake. So is assuming everyone has the bandwidth to loading megabytes worth of JavaScript.

Progressive enhancement has always been the hallmark of well-crafted websites. That means starting with the least capable devices — an older phone, Lynx running on Windows 95 — and then adding more sophisticated features based on screen size, bandwidth and so on.

The irony of rejecting older browsers today is that it’s never been easier to support them thanks to hundreds of JavaScript shims and the collective hacking knowledge of all the developers who have made the web what it is today (and have probably already solved your problem somewhere along the way).

We’d hate to see anyone limiting what their site can do simply to support older browsers, but at the same time don’t just abandon users who, for whatever reason, are still using Internet Explorer 6 or an old Nokia mobile browser. There’s a middle ground to be found and where that middle lies will vary from site to site. Finding that middle ground is the challenge all developers face. As Allsopp writes, “the truth is, the challenge of universality is daunting. It is hard work. But to me at least, paying this forward is the quid pro quo of the enormous privilege I’ve been granted to work on the web.

[Long Road in Montana by Stuck in Customs/CC/Flickr]

See Also:

File Under: Browsers

Chrome 15 Released with… Improved Start Page

Google has rolled out version 15 of Chrome to its “stable” channel. The update brings some minor cosmetic changes, including a slightly cleaner new tab page, and Google has also redesigned the Chrome Web Store with a simpler layout.

The “new tab” page, which is displayed by default for blank tabs, currently shows a thumbnail grid of the user’s most-visited websites and provides shortcuts to the user’s installed Web applications. The new version is functionally identical, but the layout and behavior have been tweaked.

Chrome's slightly tweaked new tab page

Users can page between the application shortcuts and page thumbnails by clicking an arrow or by using the navigation bar at the bottom of the page. They can also create multiple pages for the application icons. The ability to “pin” a thumbnail to the grid is no longer available, but it’s possible to drag a thumbnail to one of the application pages. Right-clicking an application icon allows users to specify whether the app should open in a regular tab, a pinned tab, or in full screen.

Alongside these changes, Google also overhauled the Chrome Web Store. The design has been greatly simplified with a design that feels more application-like. The main content area displays a grid of installable extensions, applications, and themes. It will dynamically load more as you scroll down. A sidebar on the left lets you search or filter by category, while a navigation bar at the top shows bread crumbs indicating your current location in the navigation hierarchy.

The new version is currently being rolled out to end users, but it can also be downloaded manually from Google’s website.

This article originally appeared on Ars Technica, Wired’s sister site for in-depth technology news.

See Also:

File Under: CSS, Web Standards

Discover What’s New in CSS 4

CSS 3 is still slowly making its way onto the web, but the World Wide Web Consortium (W3C), the governing body that oversees the development of web standards, is already plotting the future of CSS with CSS 4. The W3C recently released the first draft of CSS 4, adding dozens of new rules to make web developers’ lives easier.

The CSS 4 spec is brand new and no web browser actually supports any of these rules yet, but if you’re curious what the next few years will mean for CSS, the first draft offers a sneak peek at what’s in store for web developers.

The biggest news in the current draft of CSS 4 is support for the much-requested parent or “subject” selector. In CSS, rules are typically applied to the innermost selected element. That is, given the chain body header h1, the actual CSS rule will be applied to the h1 element at the end of the chain. CSS 3 offers no way to, say, style the header tag but only if it has an h1 child element. CSS 4 changes that.

CSS 4 includes a means of controlling which element in the selection chain is actually being styled. The easiest way to understand the “subject” selector is by example. Say you want to style a list (ul), but only when the user has clicked on an item in the list. You add a class “clicked” to the item (ul li.clicked) when the user clicks on it, but how do you style the whole list from that class?

With the subject selector it’s simple:

$ul li.clicked {
    background: white;
}

The “$” means that the rule is applied to the ul, rather than the li.clicked as it normally would.

The dollar sign may not end up being the subject indicator and the exact syntax will likely change before the spec is finalized. But regardless of the way it ends up being implemented, the subject selector opens up a whole new realm of CSS possibilities.

Other highlights in CSS 4 include some new pseudo selectors like the :matches() pseudo-class which greatly simplifies the process of writing complex, nested CSS. For example, you could write:

:matches(section, article, aside, nav) h1 {
  font-size: 3em;
}

The :matches() syntax eliminates the need to write out section h1, article h1 and so on. It’s handy for even simple nestings like the example above, but it becomes really powerful when you’re selecting elements that are two or three levels deep. For more info on :matches(), check out our earlier write-up on Mozilla’s :any() selector, which is the basis for :matches().

Also new in CSS 4 is the :local-link pseudo-class which allows you to style links based on domain. For example, you could style all internal links with a simple selector like a:local-link(0). The number refers to the amount of the local URL path to match. For example, if the current address is http://www.mysite.com/some/post/, a:local-link(0) would match anything point to http://www.mysite.com/, a:local-link(1) would match anything pointing to http://www.mysite.com/some/ and so on.

CSS 4 offers some handy pseudo-classes for styling user interface elements based on state, including :enabled, :disabled, :checked and half a dozen others.

For more info on what’s coming in CSS 4, check out the W3C spec (fear not, it’s surprisingly readable as specs go). Also worth a read is W3C WG member David Storey’s blog where he did a nice write-up on CSS 4, including a few things not covered here, like the awesome-sounding “time-dimensional pseudo-classes.”

[CSS pumpkin by mauricesvay/CC/Flickr]

See Also:

File Under: Browsers, CSS

Opera 12 Swaps Scrolls for Swipes With New ‘Opera Reader’

Alice in Wonderland gets the fancy paged-layout treatment in Opera 12

Opera software has released an experimental labs build of Opera 12 with support for what the company is calling Opera Reader.

Håkon Wium Lie, Opera Software’s CTO and creator of cascading stylesheets, previously proposed a new set of CSS tools that transform longer web pages into a more book-like experience, where the reader flips from page to page instead of scrolling down one long screen.

The new Opera Reader feature in Opera 12 is the first implementation of Lie’s proposed Generated Content for Paged Media standard. To try out the new Opera Reader and its book-like browsing experience, head on over to the Opera Labs site and download the latest build of Opera 12.

At its core, the Paged Media standard would offer web developers a way to paginate content — that is, take a single webpage and break it into multiple “pages,” with each page automatically fitted to the screen size of the device you’re using. For example, this article might be two “pages” when viewed on an iPad. However, because the pagination is done with CSS and the HTML remains as it is, there’s no added load time when you flip to the next page. So it’s not a tool that can easily be abused by publishers to mine extra pageviews. It adds all the good things about multi-page layouts and none of the bad.

If you’ve got Opera 12 installed, visit the new Opera Reader demo site where you can see some early experiments including the Alice in Wonderland demo shown above (note that the previous link only works in the latest build of Opera 12).

Keep in mind that this is an early version and so far the demos (and the browser support) are still very limited. Still, if you’d like to dive right in and learn how you can create book-like websites using the new Paged Media layout tools, check out the Opera Labs blog, which walks you through all the new CSS rules and how to use them.

See Also:

File Under: Uncategorized

Adobe Fixes Flash Privacy Panel so Hackers Can’t Check You Out

Adobe has made changes to a page on an Adobe website that controls Flash user’s security settings—or more specifically, to the Flash .SWF file embedded in the page that opens the Flash website privacy settings panel. The changes are intended to prevent a clickjacking attack that uses the file to activate and access users’ webcams and microphones to spy on them.

The change comes a few days after a Stanford student revealed the vulnerability on his website. Feross Aboukhadijeh posted the exploit, along with a demo and a video demonstration, on October 18. He said in a blog post that he had notified Adobe weeks earlier of the problem, reporting the vulnerability to Adobe through the Stanford Security lab.

The exploit demonstrated by Aboukhadijeh uses an elaborate clickjack “game” that overlays the SWF panel over buttons in a transparent iframe. Here’s a screenshot of the panel before Adobe’s changes:

Through a series of clicks, the exploit was able to clear the privacy settings for Flash’s web camera controls and then authorize a new site to activate and access the camera video.The changes did not prompt any pop-ups or other user notifications.

The changes made by Adobe are to the behavior of the widgets in the privacy settings panel. Here’s a screenshot of the new panel, after the exploit was attempted:

While my test of the exploit still added feross.com to my list of sites in the privacy panel, it was only successfully added with an “always ask” setting for establishing a video link.

This article originally appeared on Ars Technica, Wired’s sister site for in-depth technology news.

See Also: