In December 2018, Microsoft announced that Edge would adopt Chromium, the open source project that powers Google Chrome. Many within the industry reacted with sadness at the loss of browser diversity. Personally, I was jubilant. An official release date has yet to be announced, but it will be at some point this year. With its release, a whole host of HTML, JavaScript and CSS features will have achieved full cross-browser support.
The preview build is now available for Windows, and coming soon for Mac.
📣 Calling all web devs and tinkerers! 📣
The first preview builds of the next version of #MicrosoftEdge are ready for you – try it out now! https://t.co/I531hfmD3G pic.twitter.com/Tvh6OGGouO
— Microsoft Edge Dev (@MSEdgeDev) April 8, 2019
Not so long ago, I penned an article titled “The Long Slow Death of Internet Explorer.” Some of us are lucky enough have abandoned that browser already. But it wasn’t the only thing holding us back. Internet Explorer was the browser we all hated and Edge was meant to be its much-improved replacement. Unfortunately, Edge itself was quite the laggard. EdgeHTML is a fork of Trident, the engine that powered Internet Explorer. Microsoft significantly under-invested in Edge. The apple didn’t fall far from the tree. Edge’s User Voice website was a nice idea, allowing developers to vote for which features they wanted to be implemented. Unfortunately, as Dave Rupert put it, voting on the site was “like throwing coins in a wishing well.” The most requested features were left unimplemented for years.
There are a lot of features that pre-Chromium Edge doesn’t currently support but are available in other modern browsers and, once they’ve made the switch, we’ll be able to use them. Many of them can’t be polyfilled or worked around, so this release is a big deal.
Features we can look forward to using
So just what are those features, exactly? Let’s outline them right here and start to get excited about all the new things we’ll be able to do.
Custom Elements and Shadow DOM
Together, custom elements and shadow DOM allow developers to define custom, reusable and encapsulated components. A lot of people were asking for this one. People have been voting for its implementation since 2014, and we’re finally getting it.
HTML details and summary elements
The <details>
and <summary>
elements are part of HTML5 and have been supported since 2011 in Chrome. Used together, the elements generate a simple widget to show and hide content. While it is trivial to implement something similar using JavaScript, the <details>
and <summary>
elements work even when JavaScript is disabled or has failed to load.
See the Pen
details/summary by CSS GRID (@cssgrid)
on CodePen.
Javascript Font Loading API
This one means a lot to some people. All modern browsers now support the CSS font-display
property. However, you still might want to load your fonts with JavaScript. Font-loading monomaniac Zach Leatherman has an explainer of why you might want to load fonts with JavaScript even though we now have broad support for font-display
. Ditching polyfills for this API is important because this JavaScript is, according to Zach:
[…] usually inlined in the critical path. The time spent parsing and executing polyfill JavaScript is essentially wasted on browsers that support the native CSS Font Loading API.”
In an article from 2018, Zach lamented:
[…] browser-provided CSS Font Loading API has pretty broad support and has been around for a long time but is confoundedly still missing from all available versions of Microsoft Edge.”
No longer!
JavaScript flat and flatMap
Most easily explained with a code snippet, flat()
is useful when you have an array nested inside another array.
const things = ['thing1', 'thing2', ['thing3', ['thing4']]]
const flattenedThings = things.flat(2); // Returns ['thing1', 'thing2', 'thing3', 'thing4']
As its name suggests, flatMap()
is equivalent to using both the map()
method and flat()
.
These methods are also supported in Node 11. 🎉
JavaScript TextEncoder and TextDecoder
TextEncoder
and TextDecoder
are part of the encoding spec. They look to be useful when working with streams.
JavaScript Object rest and object spread
These are just like rest and spread properties for arrays.
const obj1 = {
a: 100,
b: 2000
}
const obj2 = {
c: 11000,
d: 220
}
const combinedObj = {...obj1, ...obj2}
// {a: 100, b: 2000, c: 11000, d: 220}
JavaScript modules: dynamic import
Using a function-like syntax, dynamic imports allow you to lazy-load ES modules when a user needs them.
button.addEventListener("click", function() {
import("./myModule.js").then(module => module.default());
});
CSS background-blend-mode property
background-blend-mode
brings Photoshop style image manipulation to the web.
CSS prefers-reduced-motion media query
I can’t help feeling that not making people feel sick should be the default of a website, particularly as not all users will be aware that this setting exists. As animation on the web becomes more common, it’s important to recognize that animation can cause causes dizziness, nausea and headaches for some users.
CSS caret-color property
Admittedly a rather trivial feature, and one that could have safely and easily been used as progressive enhancement. It lets you style the blinking cursor in text input fields.
8-digit hex color notation
It’s nice to have consistency in a codebase. This includes sticking to either
the RGB, hexadecimal or HSL color format. If your preferred format is hex, then you had a problem because it required a switch to rgba()
any time you needed to define transparency. Hex can now include an alpha (transparency) value. For example, #ffffff80
is equivalent to rgba(255, 255, 255, .5)
. Arguably, it’s not the most intuitive color format and has no actual benefit over rgba()
.
Intrinsic sizing
I’ve not seen as much hype or excitement for intrinsic sizing as some other new CSS features, but it’s the one I’m personally hankering for the most. Intrinsic sizing determines sizes based on the content of an element and introduces three new keywords into CSS: min-content
, max-content
and fit-content()
. These keywords can be used most places that you would usually use a length, like height
, width
, min-width
, max-width
, min-height
, max-height
, grid-template-rows
, grid-template-columns
, and flex-basis
.
CSS text-orientation property
Used in conjunction with the writing-mode
property, text-orientation
, specifies the orientation of text, as you might expect.
See the Pen
text-orientation: upright by CSS GRID (@cssgrid)
on CodePen.
CSS :placeholder-shown pseudo-element
placeholder-shown
was even available in Internet Explorer, yet somehow never made it into Edge… until now. UX research shows that placeholder text should generally be avoided. However, if you are using placeholder text, this is a handy way to apply styles conditionally based on whether the user has entered any text into the input
.
CSS place-content property
place-content
is shorthand for setting both the align-content
and justify-content
.
See the Pen
place-content by CSS GRID (@cssgrid)
on CodePen.
CSS will-change property
The will-change
property can be used as a performance optimization, informing the browser ahead of time that an element will change
. Pre-Chromium Edge was actually good at handling animations performantly without the need for this property, but it will now have full cross-browser support.
CSS all property
Sadly, though, the Traditionally, the web has been rectangle-centric. It has a box model, after all. While we no longer need floats for layout, we can use them creatively for wrapping text around images and shapes with the If you want to apply special styles to an entire form when any one of its inputs are in focus, then This is pretty much essential if you’re working with CSS grid. This had been marked as “not planned” by Edge, despite 3,920 votes from developers. For both flexbox and grid, only direct children become flex items or grid items, respectively. Anything that is nested deeper cannot be placed using flex or grid-positioning. In the words of the spec, when There are, unfortunately, still some bugs with other browser implementations that affect accessibility. We’ve only looked at features that will be supported by all modern browsers when Edge makes the move to Chromium. That said, the death of legacy Edge also makes a lot of other features feel a lot closer. Edge was the only browser dragging its feet on the Web Animation API and that showed no interest in any part of the Houdini specs, for example. Of course, the other huge plus for web developers is less testing. A lot of neglected Edge during cross-browser testing, so Edge users were more likely to have a broken experience. This was the main reason Microsoft decided to switch to Chromium. If your site is bug-free in one Chromium browser, then it’s probably fine in all of them. In the words of the Edge team, Chromium will provide “better web compatibility for our customers and less-fragmentation of the web for all web developers.” The large variety of devices and browsers makes browser testing one of the least enjoyable tasks that we’re responsible for as front-end developers. Edge will now be available for macOS users which is great for the many of us who work on a Mac. A subscription to BrowserStack will now be slightly less necessary. To my knowledge, the only feature that was supported everywhere except Chrome is SVG color fonts, which will no longer work in the Edge browser. Other color font formats (COLR, SBIX, CBDT/CBLC) will continue to work though. Uh, @GoogleChrome Are you planning to support #OpenTypeSVG soon? Supported in Safari (12+), Firefox (26+) even EdgeHTML (38+) Photoshop, Illustrator – but not Chrome — Chris Lilley (@svgeesus) February 15, 2019 Admittedly, Edge wasn’t the last subpar browser. All the features in this article are unsupported in Internet Explorer, and always will be. If you have users in Africa or India, you’ll need to support Opera Mini. If you have users in China, then UC browser will be important to test against. If you don’t have these regional considerations, there’s never been a better time to ditch support for Internet Explorer and embrace the features the modern web has to offer. Plenty of PC users have stuck with Internet Explorer purely out of habit. Hopefully, a revamped Edge will be enough to tempt them away. An official Microsoft blog entry titled “The perils of using Internet Explorer as your default browser” concluded that, “Internet Explorer is a compatibility solution…developers by and large just aren’t testing for Internet Explorer these days.” For its remaining users, the majority of the web must look increasingly broken. It’s time to let it die. Life is about to get easier for web developers, yet the response to the Microsoft’s announcement was far from positive. Mozilla, for one, had a stridently pessimistic response, which accused Microsoft of “officially giving up on an independent shared platform for the internet.” The statement described Google as having “almost complete control of the infrastructure of our online lives” and a “monopolistic hold on unique assets.” It concluded that “ceding control of fundamental online infrastructure to a single company is terrible.” Many have harked back to the days of IE6, the last time a browser achieved such an overwhelming market share. Internet Explorer, having won the browser war, gave in to total stagnation. Chrome, by contrast, ceaselessly pushes new features. Google participates actively with the web standards bodies the W3C and the WHATWG. Arguably though, it has an oversized influence in these bodies and the power to dictate the future shape of the web. Google Developer Relations does have a tendency to hype features that have shipped only in Chrome. Rather than being the new IE, Edge can help innovate the web forward. While it fell behind in many areas, it did lead the way for CSS grid, CSS exclusions, CSS regions and the new HTML imports spec. In a radical departure from historical behavior, Microsoft have become one of the world’s largest supporters of open source projects. That means all major browsers are now open source. Microsoft have stated that they intend to become a significant contributor to Chromium — in fact, they’ve already racked up over 300 merges. This will help Edge users, but will also benefit users of Chrome, Opera, Brave, and other Chromium-based browsers.button {
background: none;
border: none;
color: inherit;
font: inherit;
outline: none;
padding: 0;
}
revert
keyword still hasn’t been implemented anywhere other than Safari, which somewhat limits the mileage we can get out of the all
property.
CSS Shapes and Clip Path
shape-outside
property. This can be combined with the clip-path
property, which brings the ability to display an image inside a shape.
CSS :focus-within pseudo-class
:focus-within
is the selector for you.
CSS contents keyword
display: contents
is applied to a parent element, “the element must be treated as if it had been replaced in the element tree by its contents,” allowing them to be laid out with a grid or with flexbox. Chris goes into a more thorough explanation that’s worth checking out.
The future holds so much more promise
The impact on browser testing
Do we lose anything?
/cc @colorfontswtf pic.twitter.com/tgwJ3AqHm2
What about other browsers?
Is Google a megalomaniac?
From competition to collaboration
Yandex is Chromium based so I don’t see why anyone would have to test on it.
+1
We need Firefox now more than ever. The worst thing that could happen to the internet is to have Chrome be the only browser left.
Yes, absolutely! This is a fact that cannot be emphasized enough – seeing that there is already a plethora of sites and services which are optimized for Chrome/ium only. And even though Chromium is open source Google is the main contributor and can direct the project in any direction they deem fit.
I second that!
Thanks for this overview, it is very helpful.
You say “UX research shows that placeholder text should generally be avoided.”, do you have any references for that statement? I would be very interested.
Funily enough this comment field had a placeholder text :-D
Mozilla Firefox need to be more speed. Because of it only most of people uses chrome.
History shows us that the quality of the product has almost nothing to do with it’s market status. Many lousy products are on top of the heap.
The reason Firefox lost out to any other browser is a combination of marketing, collusion and monopolies held by the competition.
The reason so many users are on Chrome, is because Google has pumped literally over a billion dollars worth of marketing in it. I would argue that Google’s way to market Chrome is easily more aggressive than Microsoft’s monopoly pushing IE back in the day.
I agree with Vanderson. There are so many examples of his claim, both in tech and in non-tech branches. I would go ever further, to state that some products become crappier with a growing user base.
The most likely problems we’ll see arise now is more developers building things that were only tested on Chrome as it will effectively be the same browser engine as almost all other browsers.
This is already a real issue today. Beside small experiments on CodePen and its ilk (which can be forgiven), there are more websites in the wild using Chrome-only JS API’s, and
-webkit-*
prefixed CSS. This leads to unknowing users blaming their browser (poor Fx) and dropping it in favour of a Chromium-based one. Which in turn leads to more (dare I say lazy) developers “optimising” only for Chrome.The secondary issue is also real. The Chrome team have shown in the past they will drop features they care little for. Remember MathML and XSLT support? Dropped in the name of security, yet Javascript execution with PDFs is kept?
As developers, its our responsibility to keep the web open, and we can best do that by not excluding users and coding to standards, not one engines features.
Can you share a source for that, Ollie?
https://www.smashingmagazine.com/2018/06/placeholder-attribute/
Chrome doesn’t perform very well with screen readers like JAWS or NVDA. This might be a huge ding for the accessibility community. A little nervous about this one.
So the bugs that have gone unfixed for YEARS in all webkit-based browsers, will seep into Edge. Bugs on, for example, CSS Columns.
Didn’t Edge also have awesome support for vertical CJK text? I remember Chrome’s support for it being rather rushed and severly unfinished.
We do loose https://caniuse.com/#search=backdrop%20filter which was only implemented in Safari and Edge. :(
CSS :focus-within pseudo-class is useful for accessibility.
If you have a collapsible menu, a
<ul>
possibly, using the keyboard will get you to the individual s but using the usual :focus and :hover won’t expand the list rendering it useless unless you use a mouseThis is irrelevant to me. I use Opera most times and Chrome when Opera does not work in a handful of cases. Microsoft has already lost me.
Phil, I would suggest you use Chrome anyway, or better yet, Firefox. Opera WAS a browser for those who aim to be different, who value powerful features. Those times have gone for a long time. Opera has turned their back on a valuable portion of their user base by stripping almost all features that made Opera Opera, and left it with basically Chromium.
I don’t test anything on Opera anymore. I test on other Chromium-based browsers (like Samsung Internet) infinitely more than I do Opera. They must feel what destruction they have brought forth.
I think Microsoft had little choice, EdgeHtml was a burden on Microsoft to continue to develop and Chromium was just easier to accept especially if the Microsoft browser never gains any traction. Its much easier for Microsoft to accept defeat when its resources are not so involved. I actually think Chromium makes the web better, since most browsers now use it that makes things more compatible. We have lot’s of browser options with many different features and user focus. Its not like IE and a couple of others like in the past. Yeah Firefox could easily become a victim or at least a insignificant niche browsers running on Linux distro’s. Most notable is that even Linux users mostly use Chromium or Chrome now. Nobody seems to care for Gecko engine anymore which is a bad sign if your wanting competing web engines. In the end its a chromium web and becoming more so everyday. Good or bad, it is what it is and for me its OK.
I have to debunk the naysayers who claim we don’t have diversity in browsers. I mean we have never had so many browsers to choose from and yes many use Chromium rendering or Webkit and not Quantum. But beyond that distinction all of these browsers have a variety of features and customization. Besides who’s to say Edge Chromium will fair any better then any other Chrome clone? The problem won’t be Microsoft moving to Chromium engine, the problem still is Google Chrome itself dominates browser market share. We don’t have a Chromium problem, we have a Chrome problem.
place-content is an interesting implementation choice, honestly. It requires that you have multiple rows or columns of content in a flexbox, depending on the flex direction of course. So for example setting a place-content: center center; may not do anything unless your column (flex-direction: row assumed) has 2+ rows, and then it centers. Last time I checked, align-content doesn’t work if you don’t have multiple rows of content (again, assuming flex-direction: row).
I know that’s not what this article is about though :)
Just seems like Firefox is flailing because they can’t get their stuff together. Now they seem on a tangent with privacy even though Chrome the least private browser is by far the most popular. Too bad the whole Brendon Eich debacle really stunted Mozilla and one has to wonder who is providing any leadership anymore there? The writing was on the wall for Firefox long before Microsoft decided to go with Chromium. This demise of Firefox has been going on for awhile now. Frankly most browsers on the same web engine is going to improve compatibility all the while giving users plenty of options for browser. A much different scenario then when IE controlled the web. But I don’t see Firefox recovering and it probably won’t go away, but its not the future either.