新闻

Modernizr 3, Stickers & Diversity

While Modernizr was meant from day one to eventually become unnecessary, that day is far from here, and so development on the library goes on. Some of the things we’ve been busy with:

Version 3

Modernizr v.3 is not a mere version bump with some new additions; it is a complete architectural rewrite of the entire library and all of the 150+ community feature tests. The team and some of our great contributors have worked tirelessly to convert all of the tests to facilitate a new loading structure based on AMD, and are currently embedding the tests with important meta-data such as known issues, sample usage and more.

There is a new site in the making as well, with a new documentation page taking your feedback into account (feel free to fill out that survey if you haven’t yet), and a new download page that makes it much easier and faster to create the custom build that you need.

You can help make v.3 become a reality by closing issues, or by updating open Pull Requests to the new v.3-compatible format for tests (see this example for what that looks like).

Stickers!

While we work on version 3, you can show your support with some fancy new Modernizr stickers, courtesy of the fine folks at DevSwag. Put these stickers on your laptop, fixie bike, and anything else you’d like to “modernize” (ahem).

The stickers are just $6 for a pack of four, and all of the proceeds that go to Modernizr will be donated to the Ada Initiative. All of us here at Modernizr care deeply about having a healthy and diverse community of developers, and the Ada Initiative does great work that we support.

Diversity in tech & open source

The tech community, and in particular open source, is currently quite male-dominated. By itself that’s not so much of a problem, but it becomes more of one when it leads to increasingly male-specific behavior and cultures, which can be hostile and alienating to various groups—other men included.

Currently in tech, typically male behavior such as aggressiveness is rewarded with more visibility and, consequently, more opportunities. Discussions online, whether they’re about community diversity, ruby vs. python, or tabs vs. spaces, often devolve into a lot of verbal aggression, breeding an angry and hostile culture from which no one really benefits. Similarly, a harmless joke here or there isn’t a big deal, but the same kind of jokes over and over again breed a certain culture, and that culture is often exclusionary to people who don’t care for those jokes.

When this happens within a small group of people, it’s one thing. When it happens industry-wide, we’re excluding people from our field altogether, and that is a terrible thing that fundamentally undermines the meaning and value of our work. “Merit” is a total fallacy if you only allow a certain kind of people to be measured for it.

Our industry is vast and encompasses many different types of people. It is time to stop having this belief that tech, web development, or open source, is a community composed entirely of “other people who are just like us,” and that it gives us carte blanche for behaving however we want, or for saying whatever we want. Sexist, misogynist, racist, homophobic and otherwise exclusionary language, jokes and slurs—whether we put them in commits, source code, or comments to blog posts—are absolutely unacceptable.

It’s time for us to stop trying to get the industry or community to behave according to the rules set forth by the most vocal majority. Each and every one of us deserves to be respected and listened to, to not be shouted down by an angry mob.

We should not judge our peers solely by the quality of their code or pixels: that’s dehumanizing and wrong, and encourages individualism. It’s time for us all to embrace the diversity that we represent: different people from different backgrounds with different skills, ideas and opinions.

Since Faruk first started Modernizr in 2009, it has evolved through a collective, social effort. This wouldn't have been possible without the vast range of different contributors, each bringing their own unique slant. It’s ultimately this diversity that has allowed Modernizr to be the broad-reaching tool it has become — and it will only be able to continue to grow and improve if it sticks to and supports these ideals across the entire community.

Modernizr Policy on Browser Bugs and Feature Detects

Modernizr detects features in browsers based on the APIs they expose to enable that feature. However, sometimes a browser vendor will implement a feature, but its implementation is buggy; for instance, its API exists but the output is not rendered, or the feature doesn’t work right—or even at all. This sometimes results in what we call “False Positives”: a feature that tests positively, but is not reliable or usable. (For example, Opera Mini provides a false positive for CSS Gradients.) Other times we might calls these plain “browser bugs,” issues in the implementation that doesn’t affect the common use but is an edge case issue. (For example, box-sizing doesn't work with min-height in Firefox.)

False positives are a developer’s nightmare: they can be hard to discover, even harder to fix, and are almost always frustrating. So what can we do?

Modernizr aims for accuracy in tests based on their associated ECMAScript, HTML and CSS specifications. Yet sometimes something slips past and it reports a false positive. We are in the process of documenting these cases and putting them in one single page for easy consumption.

Found a false positive?

When you encounter a false positive, add it to the Modernizr Issues tracker. We will give it the “False result” label. Also please clearly describe which browser(s) it is a false positive in, and whether the implementation is buggy, broken or incomplete.

Wherever possible, we will attempt to work around the issue (for example: forcing a reflow, adding the element to the DOM, etc), though as a last result we will add a UA sniff. We'd appreciate your help with a pull request, as well!

Above all: report false positives to their respective vendors’ bug trackers. (Many times it's a mobile port of WebKit that has the problem; while it may not exist in other WebKit ports, you can file these at the WebKit tracker regardless.) That is the best way to get these issues resolved, and helps Modernizr to be a great feature detection library.

Browser bug?

We agree that browser bugs should be detected instead of assumed for given UA strings. This is how jQuery.support works. However, Modernizr detects features and will not be collecting bugs. We do recommend you file the issue with the appropriate vendor and blog about it or post on Stack Overflow to get the word out there with your proposed fix.

Thanks

Modernizr will strive to report accurately, even if the browser is returning a false positive for the correct detect.

Modernizr 2.6.2 released

Summer is over, back to work! We’ve released Modernizr 2.6.2 with a number of new detects, bug fixes, and test improvements for your modern development needs.

Some notable fixes include:

  • Fix for a hilarious edge case in Safari where if you set your body or html element to overflow-y: scroll and apply styles to the webkit-scrollbars (see demo), the browser spontaneously refreshes
  • HTML5 Shiv got a fix for better compatibility with jPlayer
  • Generated Content false-positive fix for IE7
  • Fix for our download builder and turning off css classes
  • Better Travis CI output for unit tests using grunt
  • All incoming pull requests are tested against our test suite with Travis CI

Detects

We’ve also added some new detects:

  • Content Security Policy
  • CSS's object-fit
  • position: sticky;
  • @supports : CSS's new native feature detection
  • viewport unit tests: vhunit, vmaxunit, vminunit, vwunit
  • input[form] attribute
  • new iframe attributes: sandbox, seamless, srcdoc
  • PointerLock API

Test improvements

And lastly, there have been updates to these tests:

  • background-size: cover
  • css filters
  • css subpixelfont
  • elem-track - reflecting partial support by IE10
  • gamepad api

For more details on the exact code changes of this release, see the full changelog on GitHub.

We thank our great dev community who have contributed much of the work for this update. Thanks to their moms and dads, too.

之前的新闻