Archive for the ‘WebKit’ category (118 posts)

Scoped Styles, Deflated WebSockets and the Vibration API

Published on in Google Chrome, Last Week, tech, WebKit. Version: Chrome 19

Last week, 912 commits landed in Chromium and 754 at WebKit, totaling up to 1,666 changes. Highlights include scoped stylesheets, parsing of properties for the Grid Layout and a new interpreter for Apple’s JavaScript engine.

Two new extension APIs have been added to Chromium, namely a fontSettings API which will (so far) allow you to retrieve the font family for a given script, and a Key Bindings API  which allows you to register shortcuts triggering events in your extension. An API has been added allowing the Chrome Web Store to install multiple extensions at once, and extensions now also support icons sized either 256×256 or 512×512 pixels.

A command line flag and an about:flags entry have been added to Chromium allowing you to enable support for scoped stylesheets. CSS rules declared in <style scoped> elements will only apply to the subtree rooted at the style element’s parent element, which will prove to be really useful for components and better encapsulation of styles.

Web Inspector’s Audit Panel gained the ability to warn developers about CSS properties which should be unprefixed. The Ctrl/Cmd {+,-,0} key combinations may now be used to control zooming of the inspector, attributes containing links can now be properly selected in the Elements Panel and, while it’s not enabled by default yet, managing IndexedDB is making visual progress now. Showing re-paint rectangles is now an Inspector option and three patches landed preparing changes in the Timeline Panel, such as the ability to align events by their start time.

Following inflator and deflator classes, WebKit’s WebSocket implementation now supports per-frame compression through the DEFLATE extension. Samsung’s Kihong Kwon landed initial support for the Vibration API. The zero-width joiner (0x200D) and non-joiner (0x200C) characters are now recognized by the JSC and v8 lexers, the PopStateEvent’s state property now equals history’s state property’s value and spin buttons now fire two events.

Initial parsing support for the grid-column and grid-row CSS properties has been added as part of support for the CSS Grid Layout module. <rt> elements won’t inherit the text-decoration property anymore, file upload controls can now stretch to make sure the text fits in the label and the click event for transformed SVG elements now is reliable.

Apple’s JavaScriptCore is now a triple-tier virtual machine, adding a new low level interpreter which is 2 to 2.5 times as fast as the old one. While performance of the triple-tiering engine is neutral on performance tests, reducing the amount of JIT’ed code delivers strong performance improvements on actual websites.

Other changes which occurred last week:

Last week also happened to be Evan Martin’s last week as a member of the Google Chrome team. Besides having made more than 1,400 commits, Evan has had tremendous impact on the project ever since he started working on it. Thanks, and good luck on your next endeavours!

Read more (1 comment) »

Calculated CSS Values, a Color Picker and the Translate Attribute

Published on in Google Chrome, Last Week, tech, WebKit. Version: Chrome 19

Another 1,642 changes landed in the repositories last week, 958 for Chromium and 684 for WebKit. Highlights include a color picker for Web Inspector and early functionality for the calc() function.

Brian Grinstead’s color picker is now enabled by default in WebKit nightlies, following some slight polishing. To aid the undo and redo system, an event has been added to monitor CSS modifications, percentage calculation for empty heap snapshotshas been fixed and the first UI for managing IndexedDB databases is available. The free-flow DOM editing experiment has endedconcluding that it wasn’t an optimal solution for highly dynamic pages. Single-click CSS editing did however get enabled by default, and the Elements Panel will now show previews for images.

Per Mike’s commit, basic usage of CSS’ calc() function have started to work in WebKit. Two new CSS properties have been added, -webkit-line-grid to support the alignment of lines in the inline direction to the line grid and -webkit-overflow-scrolling, indicating that an element with overflow scrolling should follow the platform’s behavior. Nested horizontal flexboxes for the new implementation have been fixed, the nowrap value for the flex-wrap property has been renamed to “none” and the computed style for auto flex-item-align now resolves to its parent’s flex-align.

All HTML elements now support the translate attribute. Support for the DOM Level 3 FocusEvent class has been added and the “types” attribute for HTML5’s drag and drop Clipboard object now returns a DOMStringList. As for CSS Regions, it’s now possible to check whether a named flow overflows and update the regionOverflow property for all elements. Finally, a repaint issue and a text selection issue related to Regions have been fixed as well.

Other changes which occurred last week:

And that was an update from London again, thanks for reading!

Read more (2 comments) »

Mutation Observers, Reversed Animations and Faster JPEGs

Published on in Google Chrome, Last Week, tech, WebKit. Version: Chrome 19

With 995 commits to Chromium’s repository and 754 to WebKit’s, last week brought in another 1,749 changes to the projects. Highlights include Mutation Observers being enabled for all WebKit ports and reversed CSS Animations.

Web Inspector’s Heap Profiler overview screen got some UI improvements and will now show percentages by default next to absolute usage numbers. Hovering over elements with :hover styles defined won’t lock up anymore, the debug side-bar in the Script Panel can now be hidden and DOM edits can now be undone. Brian Grinstead contributed a color picker, bridging the gap until actual <input type=color> gains support. Touch events are now supported by Web Inspector, and can be enabled through the Settings panel.

Mutation Observers have been enabled by default on all WebKit ports. The click() method is now implemented on HTMLElement, making it available for all elements in the DOM. URLs specified in <a ping> won’t be lowercased anymore, the state attribute has been added to the History’s DOM interface and the MediaStream API now supports the onstatechange event for PeerConnection. Finally, the Shadow DOM’s <shadow> element has been added.

Reverse directions for CSS Animations are now available. The calc() function can now, in limited fashion, be used with the hsl() and rgb() functions, and no longer supports the mod operator. Flexboxes can now center and refactorings are being done in preparation of multi-line support. unicode-bidi: plaintext is now supported for inline elements and line-grid-snap has been renamed line-snap.

With 41 commits in total, Haraken did another round of IDL cleanups.

Other changes which occurred last week:

And that’ll be today’s update live from Mountain View :).

Read more (3 comments) »

Bringing Google Chrome to Android

Published on in Google Chrome, tech, WebKit.

Finally we’re able to provide an answer to the many rumors which have been going around in the past few months: Google Chrome is now available for Android devices running Ice Cream Sandwich. On my Galaxy Nexus, the browser scores 343 points on html5test.com, runs the SunSpider test in 1880ms and scores 1308 points on the v8 test.

Support for the Web Platform
The first beta uses the same basis as Google Chrome 16, meaning it has most Chromium and WebKit changes up to mid October 2011. I’ve already iterated through many of the changes which were included in that release, most of which will apply for the Android version as well.

To name some highlights, Chrome for Android supports pretty much all of the Web Platform’s exciting features, including CSS 3D Transforms, GPU accelerated canvas, CSS Animations, SVG, WebSockets (including binary messages!) and Dedicated Workers. It supports IndexedDB, Application Cache and the File APIs, date and time pickers, parts of the Media Capture API and mobile oriented features such as Device Orientation and Geolocation. Fixed positioned elements are also working and even look smooth while scrolling!

What the Android-based Chrome does not support is Flash, following Adobe’s announcement in November. Other unsupported features in the beta release are Extensions/Apps, WebGL, Shared Web Workers and the Web Audio API.

An issue that often pops up for mobile browsers is that text on the website may be too small to read properly. Where the Android Browser employs a text reflow algorithm to clarify the situation, Chrome for Android features a technique which we’ve called Font Boosting. It uses an algorithm to increase font sizes when necessary, aiming to make the text readable regardless of the zoom level.

And for the Web Developers among you, it’s also possible to utilize Web Inspector’s Remote Debugging feature to inspect and modify pages while viewing it on the device itself.

Google Chrome 16 and mobile limitations
Of course, bringing a browser to a different -much more limited- platform goes further than simply re-using code. Mobile devices have a lot of limitations compared to desktop and laptop machines. Besides the lower amount of available memory and CPU power, other constraints lie in less memory bandwidth and VRAM on the device’s GPU. Google Chrome has a complicated architecture which imposed some interesting challenges here: separating the browser from the renderers through its multiple process architecture, to name an example. Decreased rendering and scrolling performance were also an issue, to which Chrome’s GPU team provided an excellent answer in the form of a threaded compositor.

Another characteristic of the Android platform is that the APIs for most significant features are exposed through the Android SDK, making them available to Java code. To this end, part of the browser layer has actually been implemented in Java, communicating with the rest of the Chromium and WebKit code through Java Native Bindings.

Becoming part of the Chromium project: upstreaming our code
Chrome for Android has been developed in a separate repository as a fork, which means that most of the code will have to be upstreamed. To date, about 150 commits have landed in Chromium making many preparations, including the build environment and bots for Chromium and WebKit, not to mention WebKit’s umbrella bug and the two announcements.

As having a fork is far from ideal, one of the current top priorities will be to upstream most new and modified code to Chromium and WebKit, while the build and testing infrastructure on Chromium’s waterfalls is expected to evolve significantly. A snapshot of the current source-code of Chrome for Android can be downloaded as a tarball.

Of course, keep in mind that today’s release is just a beta; much more work, features and stability will be needed to actually be able to release the first stable version. Personally, I’m very glad that the project has been announced, and definitely am looking forward to continuing development in the open!

Read more (24 comments) »

Chromium 19, Scoped Stylesheets and IDL Refactoring

Published on in Google Chrome, Last Week, tech, WebKit. Version: Chrome 19

1,368 changes found their way to the repositories last week, 802 for Chromium and 566 for WebKit. Highlights include Chromium 19, an Extension Activity Log page and no more high-latency audio code path.

The branch for Google Chrome 18 has been created, giving Anthony a cause to remind us about Potassium while kicking Chromium’s version 19. Approximately 6,500 Chromium, 4,400 WebKit commits and 300 v8 commits participated in this release, giving a combined total of over 11 thousand changes. Chrome 18 brings six new stable extension APIs, a CSS Selector Profiler, Mutation Observers and many, many more changes.

Work has been started on an Extension Activity Log page which will share information about API calls a certain extension makes, allowing you to keep an eye out on their behavior.

Web Inspector’s Heap Inspector is now able to show a percentage-based representation of memory usage for objects as well. The protocol version has been increased to 1.0, getting an XPath query for an item in the DOM will soon be supported and an experiment for editing styles after a single click has been started. Finally, it’s now also possible to select BlackBerry’s UA strings in the Inspector’s switcher. Work on supporting touch event emulation is progressing.

Support for fixed and percentage-based minimum widths on table elements with table-layout: auto has been implemented, and styling background colors in regions has been re-enabled as well. The preload scanner will now take the base element into account and the disabled attribute on SVG style elements is now supported.

Albeit disabled by default through a compile-time flag, basic functionality of scoped stylesheets has started working per Ronald’s commit. Limitations for selector matching in the <content> element’s select attribute are now being verified, backgrounds inside SVG’s foreignObject element will now be drawn, the Content-Language value (meta-only for now) will influence the document’s locale and fonts and SVG’s getIntersectionList method won’t cause visual distortion anymore.

Through 19 different commitsKentaro Hara has been doing a great job cleaning up IDL files throughout WebKit .

Other changes which occurred last week:

And that’s all again!

Read more (3 comments) »

Shadow DOM, Pointer Lock and a new CSS Lexer

Published on in Google Chrome, Last Week, tech, WebKit. Version: Chrome 18

929 changes landed at Chromium’s repository last week, whereas WebKit’s received 626, totaling up to 1,555. Highlights include quite some progress on implementing the Shadow DOM and the Pointer Lock API.

Web Inspector’s Timeline Panel has been extended with three graphs, all hidden behind the Experimental Settings option, showing information about objects and events in the DOM. Hovering over a function in the Script Panel may now show an overlay with general information and it’s source-code and elements within iframes are selectable again.

The Flexible Box module implementation has been taught about distributed packing and now supports scrollbars for overflowing content, also taking the flex direction into account. Furthermore, floated pseudo-elements within table captions will now be positioned correctly.

In order to verify whether ES.next’s let keyword will be compatible with websites, Apple has reserved the word from normal usage in JavaScriptCore. Support for Uint8ClampedArray has landed for both V8 as JSC, values for the dropzone attribute will be normalized and various issues with radio-button groups have been fixed.

In terms of the Shadow DOM, registering of scoped stylesheets with the scoped element has been implemented and an initial version of the <content> element is now available as well. Following an API change and the actual interface, Vincent Scheib’ Pointer Lock API has made it into Chrome Canary as well.

Other changes which occurred last week:

And that’ll be all again, thanks for reading!

Read more (4 comments) »

Content Shell, Shadow DOM and Emulating Screen Sizes

Published on in Google Chrome, Last Week, tech, WebKit. Version: Chrome 18

Last week brought 563 new commits in WebKit’s repository and 709 new commits to Chromium’s, totalling up to 1,272 changes. Highlights include a content shell for Chromium and work on emulating screen sizes.

Chromium’s content shell for Linux-based systems was announced on the chromium-dev mailing list on Friday, sharing the news that it’s now usable for day-to-day WebKit development. It uses Chromium’s content module but leaves out other parts of the browser, so it’ll be significantly faster to compile and run.

For free-flow HTML editing in the Resources Panel of Web Inspector, revisions will now be tracked. Unsafe cross-origin requests will now show a stack trace in the console, making them easier to track down and content in iframes won’t appear to be in the same document anymore when using the DOM Viewer. Finally, a screen-size emulation back-end has been implemented, which will eventually allow you to emulate mobile device screens!


The -webkit-cross-fade will now report the intrinsic size of the background, fixing rendering when the background-size property is being used. Baseline grid alignment has been implemented, as have the text-overflow property for input fields and parsing for the custom() function of CSS Shaders. Painting background colors for regions has been re-enabled, and regions will now be exposed to the DOM.

WebKit’s Device Orientation implementation has been updated with the absolute property, which indicates whether the angles in the event are absolute. The abort() method for Application Cache has been added, as has a constructor for MediaStream accepting a collection of MediaStreamTracks. A window’s innerWidth and innerHeight properties won’t be affected by page scales anymore and drop and dragend events will now be issued for contentEditable elements.

Finally, the first significant patch in exposing the Shadow DOM to JavaScript has landed in WebKit! Minor as it is right now, it’ll pave the path to implementing the rest of the specification.

Other changes which occurred last week:

Finally, be sure to take a look at HTML5 Please, a new website sharing recommendations about which features of the Web Platform can be used today!

Read more (3 comments) »

Font CSS Properties, Selector Source Location and calc() Tests

Published on in Google Chrome, Last Week, tech, WebKit. Version: Chrome 18

Exactly 1,500 changes landed last week, 890 for Chromium and 610 for WebKit, bringing changes such as some usability updates in the CSS Profiler and new font-related CSS properties.

The experimental Sidebar Extension API has been removed from Chromium. The Downloads Extension API gained an getFileIcon method and now also works for POST-download requests, and Panels may now be resized and spawned without drawing attention using the chrome.windows API. chrome.experimental.dns made its entry.

Early steps in supporting IndexedDB in Web Inspector have been made and a “source” column has been added to the CSS Profiler, directly pointing out the offending CSS rule.
As part of an ongoing effort in WebKit, several failing tests on the IE Testcenter have been fixed. Among these are executing prepared scripts even when they’ve been removed from the DOM and sandboxed i-frames will now block the autofocus attribute if the sandbox flags request it.

WebKit now also supports getting the computed style for border-radius properties. Four compliance improvements have been made to JavaScriptCore, namely that defineOwnProperty is now available for arrays, changes around the length property for arrays, defineProperty and handling of colons in timezones. Finally, the navigator.startActivity method for Web Intents has been implemented, albeit behind a compile-time guard.

Following a specification change, the flex-align CSS property has been renamed to flex-item-align and a new version of flex-align has been implemented, and the implementation has been taught about handling absolutely positioned elements within flexboxes. Color matrix-based filters will now be done by Skia for Chromium, and the serpia tone filter has been aligned color-wise for Mac OS X. Text decorations won’t propagate to all descendants anymore and several more element types can now render outlines.

Two new CSS properties were implemented. The font-kerning property from the CSS Fonts specification will allow you to define kerning behavior, and the initial implementation of the font-variant-ligatures property will allow you to explicitly enable or disable OpenType’s common ligatures feature on a font.

Other changes which occurred last week:

Some interesting things currently going on include a Baidu contribution and basic grid alignment from the CSS Line Grid specification.

Read more (6 comments) »

Media Fragments, Performance and MediaElementAudioSourceNode

Published on in Google Chrome, Last Week, tech, WebKit. Version: Chrome 18

The new year’s first week ended calmly, bringing in 547 commits to WebKit and 650 to Chromium. Highlights include support for temporal dimensions for media files, alignment of Safari’s JavaScript engine with ES5 and lots of performance improvements.

Engadget, among other sites, has become significantly faster in WebKit, now using 10% less CPU over the entire page load due to analyzing inline stylesheet scopes. A CSS Selector using multiple indirect adjacency combinators won’t be able to be superlinear anymore, inserting nodes into the DOM has been sped up and several other tweaks were implemented.

Sanitization of non-parsable strings in date and time input boxes is now possible in WebKit, emptying the value if an invalid value has occurred. The </script>-close tag will now be properly highlighted in View Source, and horizontal paddings and borders will be used instead of vertical ones for a CSS table’s fixed width.

Safari’s JavaScript engine aligned its behavior closer to the ECMAScript specification. The JSON object is now configurable, the parseInt method won’t parse octal numbers anymore, ThrowTypeError is now a singleton and date parsing has been made more liberal. Alexis Menard implemented getComputedStyle output for the outline, border, list-style, border-image and background properties. Finally, the Web Audio API is now able to integrate with audio and video elements throught the MediaElementAudioSourceNode object!

Eric Carlson implemented the temporal dimension portion of the Media Fragments URI specification. This allows you to append a formatted hash-string to any media file’s URL selecting which portion of the file should be played. For example, this plays the fourth until the twelfth second: video.webm#t=4,12.

Other changes which occurred last week:

And that’ll be all for now! Lets get back on the Monday-track for updates starting next week!

Read more (9 comments) »

CSS Selector Profiler, Source Mapping and Software Rendering

Published on in Google Chrome, Last Week, tech, WebKit. Version: Chrome 18

Happy New Year! Since I didn’t publish an update last week, this one will cover all 680 WebKit and 986 Chromium commits made in the past two weeks. Highlights include a ton of Web Inspector changes, Jarred’s work on XMLHttpRequest and access to new JavaScript features through about:flags.

Besides support for true hardware acceleration, which pretty much is a requirement for features such as WebGL and CSS 3D Transforms, attention is also being given to software renderers. Several crashes for Apple’s OpenGL-software renderer have been fixed, and support for SwiftShader has been added for Windows installations, which will automatically be downloaded if support for GPU-based WebGL is blacklisted. While performance definitely won’t be en par with GPU-based WebGL, it’s a good solution for those on older systems.

The Web Inspector team landed some great new features, most notable of which is the CSS Selector Profiler. Available through the Profiles Panel in the Inspector, it will show the number of matches for a certain element and its contribution to the total style matching run-time. Two other new features, both displayed in the image below, are the ability to dock the Web Inspector to the right-side of the browser window (through the Settings window) and an experimental tabbed interface for the Script Panel.

New, experimental Web Inspector features will be hidden behind a command line flag and a setting. Tree views in side-bars cannot be collapsed anymore using the keyboard and subsequent @rule-statements in CSS will be highlighted. The ability to remove all breakpoints has been added, as has a cool Go To Function dialog. Finally, Web Inspector gained support for Source Mapping through the X-SourceMap HTTP header. When enabled (also through the Settings window), an Install Source Map context-menu item will be added to scripts in the Script Panel.

On Chromium’s side for Web Inspector, both the chrome.devtools and the chrome.debugger Extension APIs graduated from being experimental, so hopefully we’ll be seeing a lot of extensions starting with Chrome 18!

WebKit’s HTML5 parser has received a number of updates, which include support for the Noah’s Ark condition, 93 named entities which expand to more than a single character and some minor fixes related to NULL characters in HTML content. Video subtitles through the <track> element can now be rendered on a video, and subtitles will be enabled for WebKit-mac builds, meaning Safari. Finally, the dropzone attribute got aligned with the specification.

The XMLHttpRequest implementation has also been updated, which now compares the mime-types in a case insensitive way, gained support for the loadend event and allows more liberal modification of the withCredentials and responseType attributes. More excitingly, new response types (such as json) won’t support synchronous requests in a non-worker scope anymore. Two more init*Event methods have been removed, and retrieving the computed style of the border-style, border-color and margin properties has been implemented.

Default styling of the strong and b elements has been updated to be bold rather than bolder. CSS Filters may now be used on inline elements, the blur filter will now invalidate the entire element and animating brightness, contrast and drop-shadow filters won’t be reversed anymore, and two more issues with full CSS 2.1 support have been fixed.

Other changes which occurred during these weeks:

And that’s all again. Two bugs to keep an eye out for this week are updated patches for CSS calc()’s parsing and the beforeprint and afterprint events.

Read more (10 comments) »