среда, 20 марта 2013 г.

Learning more about Pointer Events as the W3C publishes Last Call Working Draft


On Tuesday February 19, the W3C published the Pointer Events specification as a Last Call Working Draft, a significant milestone in the path towards standardization and interoperability. Begun a little over 3 months ago, the specification aims to help developers more easily enable a new generation of Web experiences that work across input devices, such as touch, pen, and mouse. We’re pleased with the progress thus far in the W3C and wanted to share some of the latest resources available to help you build sites and applications for touch, pen, and mouse input using the APIs available in IE10 today.

Learning about touch-first Web design and Pointer Events

Pointer Events represent a new way to approach input in sites. As such, we want to help developers learn about the technology and how to build compelling experiences with it. Through our engagement withWebPlatform.org documentation, program manager Rob Dolin has added an extensive new primer that walks through Pointer Events and provides basic examples on how to get started.
Additionally, I was pleased to have the opportunity to speak at W3Conf in San Francisco, CA about touch-first design and Pointer Events. If you weren’t able to attend, the talk is available to watch online. This talk covers basic touch-first guidelines, and introduction to Pointer Events, and a walkthrough of migration from mouse events to Pointer Events.
If you’re not inspired yet to try out Pointer Events, here’s a few great Web experiences that use Pointer Events for a touch-first experience, with more to come in the future:

Using Pointer Events Today

IE10 supports Pointer Events (vendor prefixed) and enables you to take advantage of the millions of touch enabled Windows 8 devices in the market. “Same markup” continues to be our goal, and standardization is just one of the ways we’re helping make that a reality. In addition, Microsoft Open Technologies, Inc. (a subsidiary of Microsoft) has been collaborating with the WebKit community to produce an open source prototype patch of Pointer Events for the WebKit project. Web developers can take this early prototype for a spin using a Chromium build with Pointer Events released by AppendTo.
To further help Web developers take advantage of Pointer Events today, David Catuhe from Microsoft France has developed a JavaScript polyfill, called HandJS, to support Pointer Events in multiple browsers. Developers can include the script library in their page and write to the Pointer Event model to get the full experience of Pointer Events in IE10 and a graceful emulation in other browsers. David also has a demo to help you get started.
We look forward to the road ahead in standardizing Pointer Events as the Working Group moves towards the next milestone, Candidate Recommendation.
— Jacob Rossi, Program Manager, Internet Explorer

Flash in Windows 8


Starting tomorrow, we are updating Internet Explorer 10 in Windows 8 and Windows RT to enable Flash content to run by default. On Windows 8, all Flash content continues to be enabled for IE on the desktop.
As we have seen through testing over the past several months, the vast majority of sites with Flash content are now compatible with the Windows experience for touch, performance, and battery life. With this update, the curated Compatibility View (CV) list blocks Flash content in the small number of sites that are still incompatible with the Windows experience for touch or that depend on other plug-ins.
We believe having more sites “just work” in IE10 improves the experience for consumers, businesses, and developers. As a practical matter, the primary device you walk around with should give you access to all the Web content on the sites you rely on. Otherwise, the device is just a companion to a PC. Because some popular Web sites require Adobe Flash and do not offer HTML5 alternatives, Adobe and Microsoft continue to work together closely to deliver a Flash Player optimized for the Windows experience.
Windows 8Windows RT
Immersive IEEnabled unless on CV listEnabled unless on CV list
Desktop IEEnabled for all sitesEnabled unless on CV list
This updates the immersive IE experience on Windows 8, and both the immersive and desktop IE experiences on Windows RT. The update will be made available to customers with Windows Update. The curated CV list applies to IE on the desktop for Windows RT since the most common reason to block Flash is that the site relies on other plug-ins that are not available on Windows RT.

More compatible Web experiences

Our approach to Flash in Windows is practical for Windows customers and developers. For Windows 8, we worked with Adobe to include a version of Flash that is optimized for touch, performance, security, reliability, and battery life. Adobe made substantial changes to the Flash player to align with the Windows 8 experience goals. We shipped this optimized Flash component as part of Windows 8, and we service it through Windows Update. IE10 with Flash on Windows 8 enables people to see more of the Web working with high quality, especially compared with the experience in other touch-first or tablet browsers and devices.
When we released Windows 8 and Windows RT we used the IE Compatibility View (CV) list to enable sites to run Flash content compatible with the Windows 8 experience, including touch responsiveness, performance, and battery life. In Windows 8, IE on the desktop runs all Flash content, like it does on Windows 7.
Looking at our engineering experience with Flash and Windows 8 and RT, as developers improve their Flash content, the vast majority of sites with Flash content that we have tested are now compatible with the Windows experience goals. Of the thousands of domains tested for Flash compatibility to date, we have found fewer than 4% are still incompatible, in the most part because the core site experience requires other ActiveX controls in addition to Flash. With Windows 8 in the hands of customers and developers, we listened to feedback around the experience of Web sites with Flash.

Developing compatible Flash content

For developers building sites with Flash content, this document posted on MSDN goes into more technical detail about the criteria used to place sites on the Flash CV block list, as well as steps that developers can take to test their content in immersive IE and submit their sites to be removed from the block list. The documentation also includes a best practices guide to help developers, designers, and content publishers create experiences with Flash that play well in IE for touch, responsiveness, and battery life. These best practices complement existing recommendations and tools like modern.IE for authoring touch-friendly HTML5 sites. Also, starting tomorrow, modern.IE enables testing whether or not your site is on the curated Flash CV block list.
For the development community, platform continuity and technology choice are important. Flash in IE10 on Windows 8 and Windows RT provides a bridge for existing sites to transition to HTML5 technologies where it makes sense and at a pace that is right for the experiences they want to deliver to their customers. With today’s update to Windows 8 and Windows RT, consumers can experience more of the Web by default.
-- Rob Mauceri, Group Program Manager, Internet Explorer

March 2013 Internet Explorer Updates


Microsoft Security Bulletin MS13-021 - Critical

This security update resolves eight privately reported vulnerabilities and one publicly disclosed vulnerability in Internet Explorer. The most severe vulnerabilities could allow remote code execution if a user views a specially crafted Web page using Internet Explorer. An attacker who successfully exploited these vulnerabilities could gain the same user rights as the current user. Users whose accounts are configured to have fewer user rights on the system could be less impacted than users who operate with administrative user rights.
This security update is rated Critical for Internet Explorer 6, Internet Explorer 7, Internet Explorer 8, Internet Explorer 9, and Internet Explorer 10 on Windows clients and Moderate for Internet Explorer 6, Internet Explorer 7, Internet Explorer 8, Internet Explorer 9, and Internet Explorer 10 on Windows servers. For more information, see the full bulletin.
Recommendation. Most customers have automatic updating enabled and will not need to take any action because this security update will be downloaded and installed automatically. Customers who have not enabled automatic updating need to check for updates and install this update manually. For information about specific configuration options in automatic updating, see Microsoft Knowledge Base Article 294871.
For administrators and enterprise installations, or end users who want to install this security update manually, Microsoft recommends that customers apply the update immediately using update management software, or by checking for updates using the Microsoft Update service.

Microsoft Security Advisory (2755801)

Today we also released an update that addresses vulnerabilities in Adobe Flash Player in Internet Explorer 10 on Windows 8. The details of the vulnerabilities are documented in Adobe security bulletin APSB13-09. The majority of customers have automatic updates enabled and will not need to take any action because the update will be downloaded and installed automatically. For those manually updating, we encourage you to read the advisory and apply this update as quickly as possible.
This update addresses the vulnerabilities in Adobe Flash Player by updating the affected Adobe Flash binaries contained within Internet Explorer 10. For more information, see the advisory.
— Tyson Storey, Program Manager, Internet Explorer

Building Vyclone's Interactive Experience with HTML5


uilding Vyclone's Interactive Experience with HTML5
The Web is more engaging and productive for consumers, as developers unlock the full potential of HTML5. In this guest blog post, Anton Molleda of Plain Concepts talks about his experience and learnings while developing Vcylone, a social video editing experience built on HTML5 and many of the new features in next generation browsers like Internet Explorer 10. Vcyclone builds on capabilities like pointer events, multi-touch gestures, and hardware accelerated canvas and CSS3 to make this Web site feel more like an app.
— Rob Mauceri, Group Program Manager, Internet Explorer
Hello everyone,
My name is Anton Molleda and I work for Plain Concepts. These last few months the team at Internet Explorer has been collaborating with the awesome crew that makes up the hot up and coming social video startup Vyclone. As a Web developer, having the opportunity to push the envelope with what the Web can do is one of my passion points. Fortunately, I’ve been lucky enough to help out on this project. And today, I want to share with you some key learning we had while we worked together to create a video editor on the Web for Vyclone, using just HTML5 and JavaScript!
Vyclone is a social video platform that lets you co-create, sync and edit multiple views of a shared moment, effortlessly.
When Vyclone first started, it solely focused on mobile devices. But soon they realized that while the recording experience is great from a phone, editing that video was limited due to the screen size and power of the device. Thanks to the progress done these last few years in modern browsers, HTML5 was a viable option as the way to go to create this new tool.
The core of Vyclone’s Web editor is composed of three parts:
The video preview: Where a low quality version of the cut the user is creating can be watched (on the left)
The vidgrid: Where all the available sources are presented to the user showing a given point and time (on the right)
And the timeline: Which indicates a linear view of which source is playing over the course of the video. A source playing during a certain amount of time is called a cut (shown above the player controls)
Vyclone's Web editor
As the user plays the video and starts adding new cuts to the timeline, the video preview switches to reflect the new source, and the vidgrid highlights the source file with triangle corners to identify to the user which video is selected.
So in building this out, we ran into a very interesting challenge with sheer amount of video manipulation, the performance we were getting back, and the user experience. Let’s dig into what we did to make this happen on the Web. So we’re using videocanvas and requestAnimationFrame (RAF). We have a video in the background that is played, and in each RAF we draw the active source into a canvas (in the video preview) or we calculate its new size and position into the vidgrid.
So far so good, but what happens when we let the user interact with it? For example, what happens when a user moves the timeline forward and back, or adds / removes video sources (cuts)? When we first started prototyping this out, we thought the standard approach would be to take care of that as soon as the event is fired - because that's the way we've been taught, right?
But what happens when those events can be fired tens of times per second, or even hundreds of times per second? And what if those handlers need to update the UI? Do we really need to force a layout refresh 130 times per second when the delta change could sometimes be less than a pixel? Talk about performance drag!
If your machine has an i7 with 8GB of RAM, you can probably afford computing power to do that. But what about people with an older rig? Or an ARM device? Those users will not have the same experience and will see the reaction time of the Web site slow way down.
Our first approach was to queue the action in the RAF but there were some problems with this approach, such as, you can RAF up the same function for the same "tick", effectively making things worse. To solve for this, our first approach was to have a variable that will tell us if the action was already queued up. Something like this:
var queued = false;
 
function myAction(){
   //your awesome code here
   queued = false;
}

function onEvent(evt){
   if(!queued){
      queued = true;
      requestAnimationFrame(myAction);
   }
}
This code is not bad but still has some problems. If you are doing something related with the event position (mouse or pointer) and a delta, you might find that you’ll struggle with this approach. The solution we used in the timeline is to accumulate the event value and process it on myAction:
var deltaX = 0,
    queued = false;
 
function myAction(){
   //your awesome code here uses deltaX
   deltaX = 0; // we reset the deltaX so it can be incremented 
               // next time onEvent is executed
   queued = false;
}
 
function onEvent(evt){
   if(!queued){
      queued = true;
      deltaX = evt.translationX; // in the case of a pointer, if you are 
                                 // using a mouse you will have to do some 
                                 // magic with pageX or similar :)
      requestAnimationFrame(myAction);
   }else{
      deltaX += evt.translationX;
   }
}
With this approach you should be pretty much ready to go. We kept adding functionality and then noticed some new problems popped up.
By handling those events when appropriate at each requestAnimationFrame we were able to achieve a higher level of responsiveness without sacrificing computing power. But since requestAnimationFrame executes the functions in the order, they are queued up so sometimes we were drawing before cleaning, or moving the timeline when we didn't have to and we had to create a lot of cumbersome code to make sure it got executed the order we wanted.
We saw that code wasn't very friendly and we were losing some cycles waiting for other actions to be performed so we decided to change again how we handled the input. It was at this moment that we thought about this as a game loop. If you’re not familiar in (simple) game architecture, the game loop is basically a continuous loop that gets executed regardless of the user interaction and splits apart when different events and actions should occur. From the Wikipedia article Game Programming, a simplified game loop in pseudo code could look like this:
while( user doesn't exit )
   check for user input
   run AI
   move enemies
   resolve collisions
   draw graphics
   play sounds
end while
That was exactly what we needed. Taking advantage of RAF we created a tick function that is executed continuously and inside this tick function we decide what we have to do depending on previous user input or other factors.
The simplified tick for the vidgrid is something like this:
   
function tick(){

   //we clean if we've changed the size of the quadrant
   if(needsClean){
      cleanCanvas();
   }

   // if we have to change the quadrant's frame because we are 
   // the active one (or the opposite)
   if(newFrame){
      drawFrame(); // we draw just the frame in a separate canvas so it
                   // doesn't need to be calculated all the time, and it 
                   // is still faster than copying from an image
   }

   //we draw the new frame if we are playing or seeking
   if(dirty){
      draw();
      drawFrameInQuadrant();
   }

   requestAnimationFrame(tick);
}
The values of needsClean, newFrame and dirty are updated on the event handlers (when the user is seeking, video playing, etc.).
It was this shift in the way we thought about the user interactions, going to a game loop mechanic, that allowed us to improve the performance and simplify our code in the editor.
Big takeaways, if you are building something is requires high interactivity and receives a lot of user input, think about how potentially using a game loop can make your life easier! It sure did for us. And if you haven’t had a chance to check out Vyclone’s sexy new Web editor (if I don’t say so myself), get going! Click ‘Remix’ on any video on Vyclone.com and you’ll see our Web editor. It works equally well with mouse or touch input. I highly recommend giving it a go on a Surface Pro!
Enjoy! Hit me up with some comments below if you have any questions!
— Anton Molleda, Plain Concepts

Imagining a More Engaging Web: 3rd Anniversary of IE Test Drive


As developers build on the full capabilities of HTML5, touch, and hardware accelerated graphics, the web today is more engaging for consumers than many imagined. The experiences developers are building today simply were not possible just a few years ago.
Saturday marked the third anniversary of the IE Test Drive site. What started as a few examples of hardware-accelerated HTML5 to help developers imagine the potential of the web, has grown to a collection of over 140 feature-packed demos. Test Drive gives you a taste of what’s possible with HTML5 and modern browsers on modern hardware: HTML5, CSS3, ECMAScript 5, touch, GPU-powered graphics, blazing performance, audio/video, mobile, games, and more.
The support you’ve shown is humbling – over the last three years the Test Drive has received over 130 million page views! That’s more than a page per second for the last three years! We’ve had a lot of fun building the demos, and thought we’d take a look back at some of our favorite demos along the way.
IE Test Drive
The IE Test Drive Site contains over 140 demos!

Demos

Audio ExplosionTouch, see, and hear IE10
CanvasPinballThe perfect work time break
ChalkboardIE10 takes other browsers to school
FishBowlHTML5, CSS3, Video, Audio, Canvas, Fish
FishIEStarted the fish revolution
Flying ImagesOur very first Test Drive!
GalacticOut of this world performance
Hamster Dance RevolutionGet ready to become addicted
Love is in the AirWe love you too
MinesweeperSpeed that’ll make your browser explode
Mr. Potato GunActions speak louder than marketing videos
Psychedelic BrowsingOur “highest” viewed demo after 2am
Speed ReadingHow fast can your browser speed read?
Touch EffectsTouch your way to a faster experience
Tracking ProtectionPutting your privacy first

Looking Ahead

IE10 continues to deliver the best performance for real world Web sites on your Windows device, and the Test Drive is a great place to experience what’s possible yourself. Take the Test Drive for a spin today and let us know what you think!
We’re always excited and humbled by the amazing experiences developers are building on the web every day. Thank you for your continued feedback and for using IE10.
— Jon Aneja, Program Manager, Internet Explorer

среда, 6 марта 2013 г.

W3C Web Performance: Continuing Performance Investments


The W3C Web Performance working group recently held the W3C Workshop on Performance on Thursday, November 8, 2012. The goal was to hear current challenges and proposals for new performance ideas for the working group to consider. There were 45 attendees from 21 organizations, including most browser manufactures (Microsoft, Google, and Mozilla), hardware organizations (Intel, Qualcomm, Nokia, Motorola), network organizations (Cisco, Akamai, F5), and top Web properties (GMail, Google Search, Bing, NetFlix, LinkedIn, Zynga, and more). Details on the presentations and discussions from the workshop can be found in this report.
Providing the ability to accurately measure the performance characteristics of Web applications and create power- and CPU-efficient applications is critical to Web performance. The W3C Web Performance working group worked on achieving those goals in its recently completed second chartered period. In under two years, the working group rapidly standardized and modern HTML5-enabled Web browsers implemented these eight interfaces: Navigation TimingResource TimingUser TimingPerformance TimelinePage VisibilityTiming control for script-based animationsHigh Resolution Time and Efficient Script Yielding. Internet Explorer 10 is the first browser to support all eight of these new APIs.
The working group has since been focused on gathering data to understand which areas to focus on in its third chartered period. In addition to the Workshop on Performance, the working group has invited performance experts to its weekly conference calls and has broadly surveyed the performance community on ideas.
Based on all the data gathered these past few months, the Web Performance working group has decided to focus on the following areas in the third chartered period:
  • Timing Metrics The working group will continue to improve the Timing interfaces, Navigation Timing,Resource TimingUser Timing and Performance Timeline. For example, we will consider providing Web workers support in the Timing interfaces and including information on video byte ranges in Resource Timing.
  • Efficient Script Yielding The working group will continue to improve on power- and CPU-efficient APIs, like the setImmediate API defined in the Efficient Script Yielding specification.
  • Prerender The working group will standardized the prerender feature which allows navigations to appear almost “instantly” in cases where the browser has high confidence that a user will visit an URL.  The way this feature would work is that the browser will proactively navigate to a Web page in a hidden tab, when it sees the “prerender” link type or has high confidence that user will visit that link. When the user does visit that link, the browser will make the hidden tab visible, giving the perception of instant navigation.
  • Resource Priorities Today, browsers download resources in the priority order that they believe are most efficient in helping the page load occur quickly. However, developers may want to prioritize some resources over others. For example, downloading images above the fold may be of higher priority than those below the fold. Though, developers can give some hints to the browser on download priority, like using the “defer” and “async” attributes in markup, these concepts do not include most resources. To help the browser prioritize downloading resources, the working group is expanding the charter to include interoperable means for developers to give the browser hints on the download priority of resources.
  • Diagnostics Interfaces Developers are interested in learning how to make their Web applications faster and less error prone. The working group is expanding the charter to include interoperable means for developers to get browser diagnostics information on their Web applications. For example, using these interfaces a developer could understand where memory is leaking or what errors users are encountering on their Web applications.
  • Beacon Today, analytics scripts will block the current page from unloading by running in a loop in order to confirm that analytics data has been sent to a Web server. This behavior will delay the navigation to the next page, resulting in user perception of poor performance. To help developers avoid that pattern, the working group is expanding the charter to include an interoperable means for developers to asynchronously transfer data from the browser to a Web server, with a guarantee from the browser that the data will eventually be sent.
  • Display Performance Developers are interested in understanding the performance of their games and animations.
    The working group is expanding the charter to include interoperable means for developers to get frame rate and throughput of the display type of information.
This working group is a great example of how quickly new ideas can become interoperable standards that developers can depend on in modern HTML5-enabled browsers. Together with industry and community leaders who participate in the working group, we hope to continue to make rapid progress on interoperable standards that will benefit developers and everyone who uses the Web.
Jatinder Mann, Internet Explorer, Program Manager

Microsoft Security Bulletin MS12-077 – Critical


This security update resolves three privately reported vulnerabilities in Internet Explorer. The most severe vulnerabilities could allow remote code execution if a user views a specially crafted Web page using Internet Explorer. An attacker who successfully exploited these vulnerabilities could gain the same user rights as the current user. Users whose accounts are configured to have fewer user rights on the system could be less impacted than users who operate with administrative user rights.
This security update is rated Critical for Internet Explorer 9 and Internet Explorer 10 on Windows clients including the Internet Explorer 10 Release Preview for Windows 7 and Windows Server 2008 R2, and Moderate for Internet Explorer 9 and Internet Explorer 10 on Windows servers. This security update has no severity rating for Internet Explorer 6, Internet Explorer 7, and Internet Explorer 8, because the known attack vectors for the vulnerability discussed in this bulletin are blocked in a default configuration. However, as a defense-in-depth measure, Microsoft recommends that customers of this software apply this security update. For more information please see the full bulletin.
Microsoft Security Advisory (2755801) Update for Vulnerabilities in Adobe Flash Player in Internet Explorer 10
Microsoft is also releasing an update for Adobe Flash Player in Internet Explorer 10 on all supported editions of Windows 8, Windows Server 2012, and Windows RT. The update addresses the vulnerabilities in Adobe Flash Player by updating the affected Adobe Flash libraries contained within Internet Explorer 10. For more information please see the full advisory.
Most customers have automatic updating enabled and will not need to take any action because this security update will be downloaded and installed automatically. Customers who have not enabled automatic updating need to check for updates and install this update manually. For information about specific configuration options in automatic updating, see Microsoft Knowledge Base Article 294871.
For administrators and enterprise installations, or end users who want to install this security update manually, Microsoft recommends that customers apply the update immediately using update management software, or by checking for updates using the Microsoft Update service.
— Tyson Storey, Program Manager, Internet Explorer