Divya Manian by Divya Manian in Blog

Post tags: odin opera-next

This post is licensed under a Creative Commons Attribution 3.0 Unported license.

What’s New in Opera Development Snapshots: 28 February Edition

There is a new Opera Next out! Download it from the links in the Desktop team's blog post or wait a while for it to show up on your Opera Next updates (Browser Identification section should show Presto/2.10.269 in opera:about).

Major Updates

  • We now have better precision handling of fixed point values used for lengths and font-sizes. This has been a significant issue with Opera as many units were rounded off. Vadim has a neat demo of how this works in reality. Check it in Opera Next and marvel at the precision!

  • Updating media query implementation to match the latest drafts of the specs, and to pass all the W3C Media Queries tests. Now you can use dpi, dpcm and dppx as unit values for the resolution media query feature. Here is an example. This also fixes issues with Opera applying rules that are within invalid/incorrect media queries.

CSS

  • Not quite CSS, but malformed fonts never stopped loading, but now they do.
  • Setting cursor property on input elements now works.
  • The spec allows border-radius to inherit. Previously this used to fail in Opera, now it no longer does.
  • There used to be random artifacts on linear gradients used with position: absolute, but this has been fixed.
  • Inset Box Shadow's offsets were calculated incorrectly if border-top-width is 0 or border-left-width is 0. This has been fixed.
  • Opera's ::first-letter CSS selector used to select even punctuation characters. But this is no longer the case.

HTML

  • For some reason, entering 5210000010001001 into a field that is of type number caused validation error. This is no longer the case.
  • Setting bgcolor=transparent on a table element seems to not make the underlying background color show but rather render table blue.

SVG

XML

  • XML document had no document.elementFromPoint but this has now been fixed.
  • XML namespaces were also not output correctly when XML was serialised for innerHTML. This has now been fixed.

ECMAScript

  • Regex matching failed to match BOM for \s. This has now been fixed.
  • Array.prototype.join and Array.prototype.concat have been made faster.
  • Improved parseInt performance.
  • The incorrect cache resolution over string values has now been fixed.
  • Not quite ECMAScript, but relevant nonetheless. The line numbers were previously reported relative to the script tag in stack traces (when you do try {} catch (e) {}). This has been fixed. Thanks to fearphage for the bug report!
  • Number.prototype.toString() was not returning accurate values accurate values for large non-base 10 numbers. This has now been fixed (seems like Chrome suffers from this bug).
  • Fixes for JSON.stringify(). A bunch of tests from JSON-test-suite were imported and used to fix our JSON.stringify() implementation. Thanks Luke Smith for this test suite!

APIs

WebRTC

  • The getUserMedia implementation has been updated to accept MediaStreamOptions.
  • If you had allowed a camera to be accessed from multiple domains, it used to crash on reload, it does not now.

Canvas

DOM

  • If you had previously set the charset of a script element from within JavaScript, you would have noticed that it gets ignored (e.g. script.charset = "ISO-8859-1". But we no longer do so.
  • selectionStart/selectionEnd were working incorrectly in a text field. This has been fixed.
  • Constants on DOMException Interface and Node interface had writable and configurable set to true. This has now been fixed.
  • Read-only properties like event.target if set in your script would previously throw an exception. This has been updated to only throw when in ECMAScript strict mode and not otherwise.
  • initEvent on a dispatched event previously threw an error, this has been rectified to have no effect at all.
  • Calling preventDefault() on a non-cancelable event previously returned true and was executed but has now been fixed to have no effect. Thanks for the report Romuald Quantin!
  • Previously scroll event did not fire when scrolling within a textarea. This has now been fixed.
  • By now you must be sensing a theme to all the DOM fixes - prevent unwanted errors from throwing. In this vein, we also have stopped XHR from firing error events and returning status code as 0 when http responses are anything but 200. In this snapshot, Opera will transparently pass through the right HTTP response codes.
  • You can now set the responseType for a XMLHTttpRequest to be json. This means the data returned would be a JavaScript object parsed from the JSON returned by the server as a response to this request.

Misc

  • How do browsers do page scroll when you press the "page down"/"space" button? How do they know how much to scroll by?

    There is no standard way of doing this, but we had an interesting issue where Opera was doing this significantly differently from other browsers. From our investigation, it seems like Chrome 15+, Safari 5+, IE9+ scroll by innerHeight - (innerHeight * 12.5%) while Gecko does so by innerHeight - (innerHeight * 10%).

    This snapshot aligns our page scroll on page down/space key to match WebKit/Trident's behaviour. Here is a fun screenshot of this behaviour across current Opera/IE/Firefox.

  • 32-bit builds running on 64-bit OS now include "WOW64" in the User-Agent String.