jQuery 1.8.2 Released

Posted on by

We’re pleased to announce that jQuery 1.8.2 is available! This version fixes several bugs and performance regressions reported from the past couple of releases, and we think the 1.8 line is pretty solid at this point. The only way to know for sure that it works with your code is to test it–so please do!

As always, we have put out the jQuery-shaped signal lights; the master control centers at the Google and Microsoft CDNs are on high alert and will soon post these files. For immediate relief, please use the copies above. If you find a problem, please post a bug report and be sure to include a test case from jsfiddle.net or jsbin.com.

The complete change log for jQuery 1.8.2 is below. If this is your first upgrade to the 1.8 line, be sure to read the blog entries for 1.8.0 and 1.8.1 to see what’s changed.

Many thanks to the patch contributors for this version; ye shall know them by their GitHub handles: timmywil, gibson042, rwldrn, joyvuu-dave, jaubourg, staabm, and sindresorhus. In addition, we thank all the community members who took the time to contribute quality bug reports with test cases. Your initial groundwork makes it possible for us to find and fix bugs.

jQuery 1.8.2 Change Log

Deferred

  • #12521: Deferred.promise( target) only works fine when typeof( target)=='object'

Event

  • #12423: jQuery breaks with Comcast Protection Guard and any anti-keylogging protection software on IE7+
  • #12436: Performance degradation with delegate events and pseudo-classes

Misc

  • #12229: Some inconsistencies/optimizations

Offset

  • #12534: .offset() throws an error on BlackBerry5 and iOS3
  • #12536: Make .offset() calc less wrong on browsers w/o getBoundingClientRect

Selector

  • #12303: Attribute selector fails if the attribute value contains :first :last
  • #12337: :nth-child selector not accurate after new child element added
  • #12361: seleter has bug
  • #12448: :contains() edge case throwing an error
  • #12492: In textarea focus event handler, $(this).is(':focus') == false in Chrome & Safari
  • #12523: JQuery renders line breaks as text nodes
  • #12526: :last selector fails to find a match
  • #12541: 1.8.0 and 1.8.1: Double :not() selector fails in IE6/7
  • #12572: :contains breaks searching iframes v1.8

Traversing

  • #12474: Using find on a collection with append does not return the correct elements

Help Us Money-ify UglifyJS 2.0

Posted on by

In nature, an ecosystem consists of the organisms, raw materials, and all of the complex interactions that shape their shared environment. The open source ecosystem is no different. Each project has its niche, and any package that is a dependency of course has dependencies of its own. jQuery is used on millions of websites, but we wouldn’t be there without the excellent tools on which we rely to build, test, and distribute our code.

One such tool is Mihai Bazon’s excellent UglifyJS. We’ve been using Uglify to compress jQuery, jQuery UI, and jQuery Mobile for nearly two years now, so if you’ve used any of our minified builds recently, you’ve benefited from Mihai’s work. Recently, he began work on UglifyJS 2.0, which will feature even better compression, support for source maps, and a command line utility. He also announced a Pledgie campaign to support his efforts.

Here at the Foundation, our goal is not just to improve libraries that start with “jQuery,” but rather the entire JavaScript ecosystem in which we all participate. That’s why we’re happy today to announce some exciting news – and to issue a challenge!

Help build UglifyJS 2.0!
Click here to lend your support to: Funding development of UglifyJS 2.0 and make a donation at www.pledgie.com !

We’ve just kicked in 500€ to the campaign to recognize his work so far, but there’s more we all can do. If the community can help us to help Mihai reach his goal of 3,000€  by the end of September, we’ll donate an additional 500€ to the UglifyJS 2.0 project!

We’re looking forward to keeping you posted on the progress here, and participating in similar endeavors in the future to help improve the tools we use each day. In the meantime, thanks for considering a donation (even a small one), and if we haven’t convinced you yet, perhaps this final exhortation will: THINK OF THE BYTES!

Update (5:30): Awesome! The Dojo Foundation has matched our donation!

jQuery 1.8.1 Released

Posted on by

It’s been a frantic but productive few weeks, and the jQuery core team is pleased to announce that jQuery 1.8.1 is released! This version fixes the issues reported by the community following the final release of 1.8.0. Here are the files, ready for you to use:

The Google and Microsoft CDNs will also have copies available soon.

The final set of bugs that were fixed are listed below. Don’t forget, folks, we love to hear about bugs in the betas and release candidates too! You don’t have to wait for a final release to test with your code. The earlier we can fix these bugs, the smoother things go for both the team and the jQuery community.

Use jQuery UI 1.8.23 and jQuery Mobile 1.1.1 or later for best compatibility with jQuery core 1.8.1.

Don’t use Quirks mode! jQuery has never supported Quirks mode and we do not perform any testing in Quirks. This can affect values like $("window").height(), and the jQuery 1.8 Quirks mode results did change in order to support some modern browser features. The majority of problem cases we’ve seen are from developers that wanted to be in Standards mode but had an invalid doctype or extraneous markup before their <html> tag. When in doubt, use the simple and short <!doctype html>.

Sizzle’s custom pseudo-selectors that take arguments have changed, but jQuery 1.8.1 provides a compatibility shim for older code. Neither Sizzle nor jQuery documented how these worked before; there is now official documentation for Sizzle. Look there for an example of best practice on writing custom pseudo-selectors that work with all versions of jQuery.

Many thanks to the team and community members who contributed patches for this release: Timmy Willison, Mike Sherov, Elijah Manor, Mike Pennisi, Richard Gibson, Corey Frang, Mathias Bynens, Oleg Gaidarenko, Nikita Govorov, Julian Aubourg, and Rick Waldron.

We’re also very appreciative to those of you who took the time to create good bug reports for jQuery 1.8.1. In the highly unlikely event we somehow managed to leave any bugs in this release, please do let us know. First check the bug tracker to see if it has already been reported. If not, create a test case using jsFiddle.net or jsbin.com with the least possible code that it takes to demonstrate the problem.

jQuery 1.8.1 Change Log

Ajax

  • #12233: jQuery.post() raises "RangeError: Maximum call stack size exceeded"
  • #12234: the .load() method,when params is null, the ajax type will be "POST", but not be "GET"

Core

  • #12282: 1.8.0 regression – document ready is fired too early on IE 9/10
  • #12329: event.js still has a reference to bindReady
  • #12350: jQuery.trim should remove byte-order-mark (BOM) characters
  • #12370: jquery android 2.1-update1 problem

Css

  • #12235: getComputedStyle is used without namespace
  • #12313: .height() and .width() no longer fall back to CSS if offsetWidth is undefined.
  • #12324: cssNormalTransform can produce wrong values

Data

  • #10863: .data method does not return an object if the JSON string contains newlines.

Dimensions

  • #12283: jQuery 1.8 outerHeight is returning undefined instead of null

Effects

  • #12273: animate fails with 0 duration

Event

  • #12149: 'change' event handler leaks in IE7/8
  • #12383: jQuery.on() selector should only apply to descendants of the element

Manipulation

  • #12346: fn.append not working correctly
  • #12384: .after fails with table rows in IE9

Queue

  • #12278: .promise(type) not working for non-default queue

Selector

  • #12205: Miscellaneous pseudo selector issues
  • #12237: Having child selector and multiple :not with :visible does not work any more
  • #12241: Passing a negative index for :eq throws a syntax error.
  • #12285: Selector with :not(:first) isn't working since 1.8
  • #12292: Invalid selectors can cause a subsequent valid selector not to work
  • #12303: Attribute selector fails if the attribute value contains :first :last
  • #12311: jQuery 1.8 and .is(":visible")
  • #12314: $.contains fatal error in IE9 when 2nd parameter is null
  • #12359: 1.8.0 creating invalid tag/attribute when loading the library
  • #12369: ajax, use find method for read xml
  • #12403: Selector "> li > :first-child,> :not(li):even" fails in old IE
  • #12409: Back-compat issue with custom pseudo selectors
  • #12412: Sizzle regression ":not([data-role='list-divider']):not(:hidden)"
  • #12419: Composite selector fails if id attribute contains dot.

Support

  • #12333: $.browser.webkit (undefined) -> $.browser.chrome

jQuery Color 2.1.0

Posted on by

Early last week I released jQuery Color 2.0.0, the wait for a jQuery Color plugin that gives you an API to work with colors is over.

What’s new in jQuery Color 2.0.0?

jQuery Color has faithfully supported animating colors between two hex values since the beginning. Many developers asked for access to the internal functions we had declared to make it all possible. Version 2 now includes an API to create and modify colors, as well as support for RGBA & HSLA colors and animations.

You can read more about the API and features on the repository readme.

Any issues should be reported on the issue tracker.

Why jQuery Color 2.1.0 already?

It’s every developers dream to land a major version perfectly on the first release, but it is rarely achieved. In the last two weeks a few minor bugs that were left in 2.0.0 have been fixed, and a new function was added to the API which should help support SVG style properties.

Download jQuery Color 2.1.0

You can download the release from our CDN provided by Media Temple.

In order to save on file size, the jQuery Color plugin only supports the Basic color keywords by default, the Extended Color Keywords are included in a separate file. If you want to include both, you can also download the bundled version.

Credits

Thanks go out to Dan Heberden, Scott González, Jörn Zaefferer, Mike Sherov, Brendan Byrd, and Christoffer Sawicki who helped make this release happen.

jQuery 1.8 box-sizing: width(), css(“width”), and outerWidth()

Posted on by

One of the great new features in jQuery 1.8 is a built-in understanding of box-sizing: border-box which is supported by every modern browser. (Sorry, IE6 and IE7, please take one step back; I said modern browser.)

If you showed people an element with a border on the screen and asked them the width of that element, they would naturally measure from the outside edges of the border. Yet that’s not the way CSS works in its default content-box mode. Normally, CSS width and height only include the “content” inside the border and padding. As a result, designers (and jQuery) often need to add the width to the right/left padding and border to get the “natural” width of the element.

Using box-sizing: border-box changes the CSS notion of the width of an element to include both the padding and the border dimensions, just the way you’d naturally measure it. jQuery versions before 1.8 were not fully trained in the ways of the border-box, but we’ve fixed this bug.

One thing that hasn’t changed is the return value of the .width() method. As it’s always been documented, it gets and/or sets the “content” width of an element, and that is regardless of the CSS box-sizing being used by the element. However, jQuery 1.8 now needs to check the box-sizing property whenever you use .width() so that it can decide whether it needs to subtract out the padding and border width. That can be expensive—up to 100 times more expensive on Chrome! Fortunately, most code doesn’t use .width() enough times for this to be noticeable, but code that gets the width of dozens of elements at once could be impacted.

There is a very easy way to avoid this performance penalty if it does impact your code. Simply use .css("width") instead of .width() to make it clear you want to get or set the actual width of the element as specified by the CSS. That doesn’t require jQuery to look at box-sizing. Remember, however, that .css("width") as a getter returns a string with “px” at the end, so you’ll want to use something like parseFloat( $(element).css("width") ) for situations where the result must be numeric.

And of course, everything mentioned here about .width() also applies to .height() as well; use .css("height") to skirt the performance penalty there.

Using .outerWidth() as a setter

In other dimensionally related news, jQuery’s .outerWidth() and .outerHeight() methods have been updated in 1.8 so that they can be used as setters. (jQuery UI has supported them as setters since UI version 1.8.4, but now it’s built into core.) To use .outerWidth() as a setter, pass an argument that is a number representing the outer width (CSS “content” width, plus padding and border width). And yes, this handles the box-sizing: border-box situation fine as well; it’s basically the same as setting the .css("width") in that case.

We’ve received a few reports from people who had problems with .outerWidth() in jQuery 1.8 because it was returning the jQuery object instead of a numeric width. This happens if you call $(element).outerWidth(0) for example. Before jQuery 1.8, this was an invalid use of the API because it was documented to accept a single Boolean argument. However, it treated the invalid argument as a Boolean and returned the width. In 1.8, jQuery uses the value 0 to set the width, and like most setters it returns the jQuery object.

We’re in the process of updating the API documentation for all the changes to 1.8, but for now you can refer back to the changelog in the jQuery 1.8 announcement to see what’s changed.

jQuery 1.8 RC1 Released

Posted on by

jQuery 1.8RC1 is here. Yep, RC as in Release Candidate. The good news is that this release is a few days later than I expected it to be. It’s good news because we received several valuable but last-minute bug reports we were able to fix. Many thanks to those of you who took the time to try out Beta 2 with your code, and especially to those who found and reported bugs.

Now I know there are a lot of you out there thinking, “Gee whiz, nobody ever lets me find bugs.” Well, here’s your chance to be a hero to the jQuery community. In this Release Candidate we may have taken some working features and inserted problems so obscure that even we don’t know where they are. Please find them! Just grab the code from here:

http://code.jquery.com/jquery-1.8rc1.js

Try out this Release Candidate code wherever you use jQuery, and let us know about any issues you find via the bug tracker. Be sure to mention you’re testing against jQuery 1.8 RC1, and please create a test case that shows the bug using jsFiddle.net so we can reproduce it and investigate. You can use the “jQuery (edge)” choice for framework in jsFiddle, which represents the most up-to-date code.

Oh, and did I mention this is a Release Candidate? Yeah, I did. Who knows if there will ever be a jQuery 1.8.1? If you find a bug after we release jQuery 1.8, it could be six months before it’s fixed. Six months of misery, all because you didn’t test the Release Candidate! One and a half women could make a baby while you’re waiting for that critical bug fix! For your own sake, please try it out!

jQuery 1.8rc1 Change Log

The current change log of the 1.8rc1 release.

Ajax

  • #8205: JSONP random result is causing memory leak in IE8
  • #8653: jQuery.param outputs "null" and "undefined" in the query string
  • #9399: Deprecate jqXHR.success and jqXHR.error
  • #10285: evalScript rcleanScript replacement fails in IE8
  • #10524: jQuery.fn.load does not merge data parameter with jQuery.ajaxSetup
  • #10944: $.ajax does not always return an object implementing the Promise interface
  • #11013: Deprecate use of Deferred/Promise with sync $.ajax
  • #11402: evalScript function fails with error error 80020101 in IE
  • #11743: jQuery silently ignores errors during script tag ajax request in $.appendTo()
  • #11778: Cached XHR requests should still resolve asynchronously
  • #12122: jQuery.ajax() async deprecate use with $.Deferred

Attributes

  • #11153: jQuery 1.7 Strips Carriage Returns in IE 8
  • #11212: Sizzle.getText converts unbreakable space into whitespace on IE
  • #11547: XML DOM .removeAttr() doesn't remove cased attributes
  • #11962: Standardize getter return values for empty sets.
  • #12127: Clone does not correctly copy checked state in IE10

Build

  • #11767: Support custom build without effects
  • #11789: Update README to describe grunt build system
  • #11856: modularize dimensions
  • #11857: modularize css
  • #11865: modularize offset
  • #11965: Create deprecated.js to contain as much of the deprecated stuff as possible

Core

  • #10657: Deprecate jQuery#size() in favor of jQuery#length
  • #11290: selector interpreted as HTML
  • #11470: Adding a builtin readyP promise
  • #12018: $(document).ready() fires too early in IE8
  • #12026: Let $(html, props) use any jQuery.fn method

Css

  • #10373: `document.defaultView` => `window`
  • #10413: width, innerWidth, innerHeight, outerWidth, outerHeight are inaccurate for a "box-sizing: border-box" child of hidden parent
  • #10679: CSS3 vendor prefix support
  • #11004: getWH incorrectly removes padding and border width when box-sizing is border-box
  • #11787: Remove jQuery.curCSS
  • #12088: Webkit now returning percentages for more getComputedStyle properties
  • #12148: hide event don't fire when toggle

Data

  • #7579: jQuery.data() truncates numbers taken from data-xxx attributes
  • #10589: Remove $.fn.data("events")

Deferred

  • #11010: Make Deferred.then == Deferred.pipe like Promise/A
  • #11011: Allow traditional options object for $.Callbacks flags
  • #11736: Remove Deferred .isResolved() and .isRejected()
  • #11749: Preserve context objects when multiple Deferred object are passed to $.when()

Dimensions

  • #6724: wrong $(window).height() in mobile safari (iphone)
  • #10877: Make outerWidth/Height a setter
  • #11293: Reading width or outerWidth of empty TDs alters columns width values
  • #11604: Switch $(elem).width(-val) from no-op to $(elem).width(0)
  • #11724: $(document).height() changed in Firefox 12

Effects

  • #7109: animate width starts with invalid width on webkit
  • #7157: Animation callback shows element is still ":animated"
  • #8387: flickering problem with jQuery 1.5 hide/show issue with inline and inline-block elements on webkit browsers
  • #8627: .animate() fails on letterSpacing in IE (regression in 1.5.1)
  • #8892: Callback is raised before objects are shown with fadeIn() and jQuery.fx.off = true
  • #9217: javascript error in IE8 when animating element is removed before animation finishes
  • #9505: animate() issue when mixing percentages and pixels in WebKit
  • #11635: Explicit overflow:auto is overridden by inline overflow:hidden during animation
  • #11755: animate and it aliases should not use :hidden selector
  • #11797: New animation related events
  • #11854: percentage animations jump to end
  • #11971: Animating background-position fails in IE8
  • #11999: Incremental animation on fixed div does subtraction instead of addition in Chrome.
  • #12117: overflow hidden not properly set when animating to 0 height or width
  • #12150: border-spacing property accumulates when rows are shown and hidden

Event

  • #8545: Leak with events in IE
  • #10067: Firing $.ready on document.readyState === 'interactive' too
  • #10895: The doScrollCheck ie hack in bindReady degrades ie7 performance for no reason whatsoever
  • #11101: Deprecate "exclusive" events option from trigger method
  • #11315: Problems with delegate() and :first in nested elements with equivalent classes
  • #11328: Ctrl key doesn't set event.metaKey to true on Windows
  • #11382: Mouseenter doesn't fire on a disabled input element
  • #11500: Bug : "change" event handler not executed when triggered manually on IE7 & IE8
  • #11621: Triggering a event on document doesn't bubble to window
  • #11718: Deprecate .data() events
  • #11719: Deprecate .bind("ready") event
  • #11731: Deprecate "hover" pseudo-event
  • #11733: Deprecate .load(), .unload(), and .error() methods
  • #11764: Allow delegated non-native events on disabled elements
  • #11786: Deprecate .toggle( handler, handler, … ) signature

Manipulation

  • #8894: appendTo() and alike methods called after clone() returns incorrect jQuery set in IE
  • #10324: Clone does not copy innerHTML of object element in IE9
  • #11231: Append, Prepend, After, Before should accept an array as first argument
  • #11338: Inconsistent behavior with .replaceWith() and disconnected nodes.
  • #11528: ie8 serialization bug with .html() also hitting html5 tags
  • #11566: node.append et al. does not work when node is a DocumentFragment
  • #11617: Define a $.parseHTML method for creating HTML fragments
  • #11809: Memory leak in .text(val) setter?
  • #11898: prevAll() with a complicated :not() selector returns results in wrong order
  • #12132: IE10 bug when cloning an object element without a parentNode

Offset

  • #10996: Simplify offset()
  • #11823: Remove webkitConvertPointFromNodeToPage

Selector

  • #3778: selector matching issues
  • #5568: Selectors behave differently with comments tags on FF/IE
  • #7596: xpath selector attribute name with brackets [] fails
  • #8473: In IE9rc *[tabIndex] select all elements without tabindex also
  • #8906: .(prevAll('span:has(input,select,textarea)')
  • #9400: Deprecate :text, :radio, :checkbox, etc. selector extensions
  • #9810: Rewrite Positional Selector Logic
  • #10003: Regression/BC break from #6963
  • #10074: Chaining two [] selector with :first not working
  • #10499: :nth-child() inside :has() treated as if outside it
  • #10570: :text selector throws an error in IE7 when there is a cross domain iframe on the page
  • #10697: Sizzle revamp
  • #10799: Inconsistent results with [name="name"] selectors (also breaks .has)

jQuery 1.8 Beta 2 Released

Posted on by

It’s been a crazy few weeks around jQuery Central, what with the release of Beta 1 and the jQuery Conference in San Francisco following that. Fear not! Between all the travel, conferences, meetings, and blog posts about the future of jQuery, we’ve actually managed to write some more code. As proof, here is jQuery 1.8 Beta 2:

http://code.jquery.com/jquery-1.8b2.js

This is the critical section in the program where we call on you, the jQuery community, to help us bring this one home. Use Beta 2 with old browsers, new browsers, red browsers and blue browsers. (That’s IE6, Chrome Canary, Opera, and Internet Explorer, respectively.) Test this file with all your code, please test it well in every mode. Did something break in Beta 2? Please tell us now before we’re through!

With assistance from those of you who tested Beta 1, we found a few bugs and squashed them. We can’t emphasize enough how important it is for us to get feedback from you as you test with these beta versions. We don’t like releasing final versions that cause problems when you drop them into your web pages, and the way to prevent that is to test with the beta and let us know about problems in advance.

NOTE: This release required coordination with jQuery UI to fix a few problems. For that reason, pages using jQuery UI will need to include the latest UI master version to test against jQuery 1.8b2. You can get it here: http://code.jquery.com/ui/jquery-ui-git.js. There will be a maintenance release of jQuery UI 1.8 that includes jQuery core 1.8 support, but users are encouraged to update to jQuery UI 1.9 when it is released.

If you find a problem, please try to reduce it to a simple test case. jsFiddle is our preferred way to get test cases, since it allows us to tweak the test case, diagnose the problem, and explore solutions. (Select jQuery (edge) for the framework, which is the latest code.) With test case in hand, head over to the bug tracker and let us know what happened. Thanks!

In addition to bug fixes reported in Beta 1, this new beta also has a significant rewrite of the Sizzle engine for even better performance. It fixes a big pile of bugs related to IE 6, 7, and 8 and makes those browsers more consistent to use. Perfection with oldIE will always be an elusive thing, but we’re still trying to make your development life as easy as possible no matter the browser.

If you build your own custom versions as described in the README file on Github, you now have the option of leaving out some of the deprecated functionality that will be removed in future versions. We’ll be adding to this file as we isolate additional deprecated functionality.

Below is a complete list of the changes since jQuery 1.7.2.

jQuery 1.8b2 Change Log

The current change log of the 1.8b2 release.

Ajax

  • #4624: Charset in default ajaxSettings.contentType
  • #10978: jQuery.param() should allow non-native constructed objects as property values
  • #11264: evalScript() uses defaults set by ajaxSetup()
  • #11426: jQuery.ajax() always fails when requesting JPG images in IE

Attributes

  • #5571: Allow chaining when passing undefined to any setter in jQuery
  • #10828: attr("coords") returns undefined in IE7
  • #10870: Incorrect behaviour of $.removeAttr("selected")
  • #11316: Consider looking through valHooks by element type first, then by nodeName instead of the other way around

Build

  • #10692: Configure the jshint options to more accurately match the style guide
  • #10693: generalize the "test something in an iframe" code in unit tests
  • #10901: have unit tests fail if the tester is running from file:// or doesn't have PHP
  • #10902: ability to test a built version of jQuery in unit tests
  • #10931: Unit tests shouldn't require internet access

Core

  • #10466: jQuery.param() mistakes wrapped primitives for deep objects

Css

  • #10639: outerWidth(true) and css('margin') returning % instead of px in Webkit
  • #10754: have jQuery.swap return the return of the callback instead of just executing it
  • #10782: Incorrect calculating width
  • #10796: Bug in IE7 with $('#el').css.('background-position')
  • #10858: css.js regular expressions are incomplete
  • #11119: The curCSS function only need 2 arguments

Data

  • #11309: hexadecimal-formatted data-* attributes parsed incorrectly

Deferred

  • #11306: calling .disable() or .lock() on a $.Callbacks object breaks its fired() status

Effects

  • #8498: Animate Hooks
  • #10006: method show is not working as expected in all browsers when called for document fragment
  • #10848: Animation toggling loses state tracking in certain atomic edge cases
  • #11415: Silently ignore negative CSS values where they are illegal
  • #11469: Negative margin in animations (.animate)

Event

  • #8165: .live('click', handler) fires on disabled buttons with child elements in Chrome
  • #10819: Eliminate "this.on.call(this, "
  • #10878: $("select").live("change", function(){ …broken in IE8 in jQuery 1.7
  • #10961: Error in XRegExp using jQuery 1.7.1 in IE6-9
  • #10970: The .on() selector parameter doesn't work with :not(:first) selector
  • #10984: Cannot off() custom events ($.event.special)
  • #11021: Hover hack mangles a namespace named "hover"
  • #11076: .clone(true) loses delegation filters
  • #11130: jQuery.fn.on: binding map with null selector ignores data
  • #11145: $(document).on() not working with name="disabled"

Manipulation

  • #9427: Passing undefined to .text() does not trigger setter
  • #10753: inline the evalScript function in manipulation.js as it's only used once
  • #10864: text() method on a document fragment always returns the empty string
  • #11055: Update HTML5 Shim elements list to support latest html5shiv
  • #11217: Append problem with webkit
  • #11291: Cloning XMLDoc's with HTML5 nodeName's breaks on IE
  • #11323: script tags with type="text/ecmascript" leak into the DOM
  • #11356: safeFragment memory leak

Misc

  • #10952: .fired() doesn't work on Callbacks object when it is flagged with "once"
  • #11257: Wrong path to source files in test suite if PHP missing

Queue

  • #10967: .promise() does not attach methods onto target

Support

  • #7986: Bug in $.support.boxModel if page has DIV-element CSS
  • #11048: Support Tests affect layout for positioned elements in IE6-9
  • #11337: Bug in $.support.reliableMarginRight

Traversing

  • #11370: $('<div>').siblings() throws exception

Just Added: Training at SF jQuery Conference!

Posted on by

In response to the flood of requests and emails, and our original promise to work on this, we’ve got an announcement: we’ve added a single day Beginner/Intermediate training right before the San Francisco jQuery Conference :)

Tickets are on sale now (left side, below the fold). The training will be provided by our friends at Bocoup, and hosted by the ever-generous folks at Microsoft. Here’s a snippet of what Trainers Ben Alman and Rebecca Murphey will be covering:

At Bocoup’s intermediate one-day jQuery training, you’ll work with jQuery veterans to build a foundation that will make you a stronger developer and get you prepared for all the great talks that you’ll see over the next two days. You’ll even learn the basics of creating your own jQuery plugin. Topics that will be covered include:

  • The jQuery() function
  • Selecting & Traversing
  • Manipulating the DOM
  • Making stuff happen with Events
  • AJAX
  • Enhancing with Effects
  • Extending jQuery with Plugins
  • jQuery UI
  • jQuery Mobile

To note: the training and conference are both in San Francisco, but take place in different locations. The training is in the heart of San Fran on Market Street, and the conference is about five to ten minutes from there, on the UCSF Mission Bay campus. Please also note that the conference and training require separate admission tickets, so make sure you’ve purchased both if you’d like to attend both.

We’re still working on the possibility of adding an Advanced training, but thus far have had mostly requests for beginner materials. So here that is :)

Hope you’ve all bought your tickets to the conference; can’t wait to see you there!

Getting Touchy About Patents

Posted on by

Touch events have become a hot topic for web developers as more and more companies move into the mobile space. Most of us know that touch events support single and multi-touch tracking. Some of us know the trickiness of working with touch and mouse at the same time. Fewer know that there are multiple touch event models, and even fewer have tried to support multiple models at the same time. I’d like to talk about where we are today, how we got here, and the potential problems we may face in the future.

A Brief History

Back in 2007, Apple introduced the iPhone, and with it came touch events. Neil Roberts sums up the Apple implementation well in a SitePen article: “Though at first the APIs seem a little sketchy, once you’ve learned them you should be able to do amazing things in your application.” Sure enough, we’ve seen plenty of amazing things, without too much complaint of the “sketchy” API. This model was later implemented by Android, Nokia, RIM, Opera, and others. Apple’s implementation is still only available in their private fork of WebKit; it wasn’t until the end of 2009 that touch events first appeared in the main WebKit repo, coming from the Android implementation.

Also in 2009, the W3C started discussing a unified pointer model for DOM Level 3 Events. The idea was that touch (including multi-touch), pen/stylus, and mouse events would be coalesced into a single model, making it easy to support all pointer types at once. However, this was abandoned because the goal at the time was to keep the spec as small as possible in order to become a recommendation faster.

Another two years later (March 2011), Mozilla released Firefox 4, featuring their own flavor of touch events. The Mozilla model is much closer to the mouse event model and the abandoned W3C model in that the event objects are flat; properties such as event.pageX exist and there is no touch list. If you want to track multiple touches, you can do so via the event’s streamId. Mozilla later deprecated this implementation in favor of an emerging W3C spec based on Apple’s model.

In January 2011, the W3C started drafting a Touch Events spec based on the WebKit implementation. A few months later, it became a Working Draft, and in December it became a Candidate Recommendation. The next month, a Patent Advisory Group (PAG) was formed in order to investigate patents disclosed by Apple. Apple’s absence from the Touch Events Working Group (WG) and their patent disclosure has caused the W3C to stop work on the spec and they do not plan to continue until the PAG has concluded and/or makes a recommendation to the WG. As of this writing, the PAG has not made a decision about the impact of the patents, but the group’s goal is to reach a speedy conclusion.

Meanwhile, Microsoft took a different approach to touch and has implemented their own pointer events in IE10 with the MSPointerEvent object. The MSPointerEvent object is similar to the original Mozilla implementation, in that the event objects are flat and contain a pointerId property. However, there are some important differences between MSPointer and all of the other models, which are touch-specific.

Note: The above is just a brief history of touch events on the Web; if you’re interested in the history of touch interfaces, you might want to check out Bill Buxton’s Multi-Touch Systems that I Have Known and Loved.

Pointer Events vs. Touch Events

As mentioned above, generic pointer events such as the original W3C idea or MSPointer, have the benefit of supporting multiple pointer devices. In fact, with a Samsung tablet running Windows 8, mouse, pen, and fingers are all normalized to MSPointer; you can even use the pointerType property to determine which type of pointer is being used. In addition to supporting all current pointer devices, MSPointer is designed in such a way that future devices can easily be added, and existing code will automatically support the new device. Even better, MSPointer event objects have the same structure as other events, reducing the learning curve compared to the conglomerate of TouchEvent, TouchList, and Touch.

Another big difference between MSPointer and Touch is that MSPointer has support for hovering (over and out events). While most touch devices have a hardware limitation that doesn’t allow for hovering, Sony recently announced the Xperia sola with “magical floating touch technology.” This brings up an important issue: Touch Events were designed based on a specific device for a specific type of input. Pointer Events represent a completely different approach to input on the Web. While we’ve already covered how this impacts developers, it’s interesting to consider the impact on hardware manufacturers. In order for Apple to succeed with touch interfaces, they had to create a new event model. Innovation for new form factors and new input methods will either be stifled by the existing standards or will require a new set of APIs, following in Apple’s footsteps with the iPhone and Touch Events. Pointer Events provides a clean solution not only for developers, but for hardware manufacturers as well. It’s conceivable that in a few years developers could use Pointer Events as the only event model for pointers, leaving Mouse Events as a thing of the past.

A Splintered Future

Although the W3C is still planning to move forward with the Touch Events spec (pending a recommendation from the PAG), the future is unclear. Even if the PAG determines that Apple’s patents don’t apply and the spec becomes a W3C Recommendation, it’s not clear that Microsoft would implement such a model given the need for a multi-input event system in Windows. If the W3C were to change directions and start a Pointer Events spec, it’s not clear that Apple, or more broadly WebKit, would implement the new event model. It’s entirely possible that even with a W3C Recommendation, we’ll be stuck for years without a consistent event model across browsers and devices.

Regardless of which model the W3C chooses to pursue, jQuery is dedicated to filling in the gaps, just like we do for other events such as submit and change. We think the pointer event model is easier to use and more future-proof, and we hope that it can be standardized, even if Touch Events are standardized as well. However, we are only interested in normalizing to a W3C Recommendation, and will not provide custom pointer events if there is no official W3C specification. We’re working with the W3C and Microsoft to try to find the best way forward for our users and the Open Web.

Call to Action: Microsoft to Submit Pointer Event Proposal

We would like to publicly call upon Microsoft to submit a proposal to the W3C for Pointer Events. The Touch Events Working Group, and by extension various browser vendors, have stated interest in pointer events. The most effective way to proceed would be for Microsoft to officially submit a proposal to the W3C.

Call to Action: Community to Experiment with Both Event Models

We would also encourage the community to experiment with Touch and MSPointer. Play with the APIs, build apps, and provide feedback. If you’re interested in this, but don’t have the necessary hardware, consider pairing up with one or more local developers who do. While there are a lot of developers building on top of Touch, there are very few people building on top of MSPointer, and even fewer publicly comparing them. We encourage you to send your feedback directly to the W3C public-webevents mailing list, but feel free to leave feedback here and we will pass it along.

Call to Action: Submit Prior Art

If you know of any prior art for multi-touch/touch lists, even outside of the Web, please get in touch with the W3C. This includes programming models and APIs, especially those using events. This will help the Patent Advisory Group come to a conclusion sooner. Again, if you’d rather leave comments here, we will pass them along.

jQuery 1.7.2 Released

Posted on by

jQuery 1.7.2 is looking good! The release candidate went smoothly so we’ve made only one small change and are releasing it to your eager hands today. You can get the oven-fresh code from the jQuery CDN now, with Google and Microsoft CDNs soon to follow:

Note: If you’re using jQuery Mobile, please use jQuery 1.7.2 only with jQuery Mobile 1.1. For previous versions of jQuery Mobile, stay with jQuery core 1.7.1 or earlier.

You can use the bug tracker to report bugs; be sure to create a test case on jsFiddle so we can figure it out easily. If you’re not sure it’s a bug, ask on our forum or on StackOverflow. Please don’t use the blog comments below to report bugs.

As always, this release wouldn’t have been possible without the hard work of many people. First, the jQuery Core Team: gnarf, jaubourg, mikesherov, rwldrn, and timmywil. The support of the jQuery UI, Mobile, and Infrastructure teams was greatly appreciated as well, especially danheberden’s valiant struggle against Trac.

Community members like adebree, caii, cmc3cn, KYSergey, mathiasbynens, miskith, MrMamen, Orkel, pasky, SineSwiper, tavelli, and vlazar pitched in by reporting, verifying, and fixing bugs. Special jQuery Gold Leaf Cluster thanks to gibson042 and sindresorhus for their work in making 1.7.2 a great release. Don’t let these people have all the fun! If you’d like to contribute to the web’s most popular Javascript library, hop onto #jquery-dev on IRC or the Developing jQuery Core section on our forum and say hello!

Many thanks to Louis-Rémi Babé, who submitted a patch to fix a regression with negative margin animations a mere 30 minutes before the release!

jQuery 1.7.2 Change Log

Here’s the change log of the 1.7.2 release.

Ajax

  • #4624: Charset in default ajaxSettings.contentType
  • #10978: jQuery.param() should allow non-native constructed objects as property values
  • #11264: evalScript() uses defaults set by ajaxSetup()
  • #11426: jQuery.ajax() always fails when requesting JPG images in IE

Attributes

  • #5571: Allow chaining when passing undefined to any setter in jQuery
  • #10828: attr(“coords”) returns undefined in IE7
  • #10870: Incorrect behaviour of $.removeAttr(“selected”)
  • #11316: Consider looking through valHooks by element type first, then by nodeName instead of the other way around

Build

  • #10692: Configure the jshint options to more accurately match the style guide
  • #10693: generalize the “test something in an iframe” code in unit tests
  • #10901: have unit tests fail if the tester is running from file:// or doesn’t have PHP
  • #10902: ability to test a built version of jQuery in unit tests
  • #10931: Unit tests shouldn’t require internet access

Core

  • #10466: jQuery.param() mistakes wrapped primitives for deep objects

Css

  • #10639: outerWidth(true) and css(‘margin’) returning % instead of px in Webkit
  • #10754: have jQuery.swap return the return of the callback instead of just executing it
  • #10782: Incorrect calculating width
  • #10796: Bug in IE7 with $(‘#el’).css.(‘background-position’)
  • #10858: css.js regular expressions are incomplete
  • #11119: The curCSS function only need 2 arguments

Data

  • #11309: hexadecimal-formatted data-* attributes parsed incorrectly

Deferred

  • #11306: calling .disable() or .lock() on a $.Callbacks object breaks its fired() status

Dimensions

  • #3838: $(document).height() incorrect in IE6

Effects

  • #8498: Animate Hooks
  • #10006: method show is not working as expected in all browsers when called for document fragment
  • #10848: Animation toggling loses state tracking in certain atomic edge cases
  • #11415: Silently ignore negative CSS values where they are illegal
  • #11469: Negative margin in animations (.animate)

Event

  • #8165: .live(‘click’, handler) fires on disabled buttons with child elements in Chrome
  • #10819: Eliminate “this.on.call(this, “
  • #10878: $(“select”).live(“change”, function(){ …broken in IE8 in jQuery 1.7
  • #10961: Error in XRegExp using jQuery 1.7.1 in IE6-9
  • #10970: The .on() selector parameter doesn’t work with :not(:first) selector
  • #10984: Cannot off() custom events ($.event.special)
  • #11021: Hover hack mangles a namespace named “hover”
  • #11076: .clone(true) loses delegation filters
  • #11130: jQuery.fn.on: binding map with null selector ignores data
  • #11145: $(document).on() not working with name=”disabled”

Manipulation

  • #9427: Passing undefined to .text() does not trigger setter
  • #10753: inline the evalScript function in manipulation.js as it’s only used once
  • #10864: text() method on a document fragment always returns the empty string
  • #11055: Update HTML5 Shim elements list to support latest html5shiv
  • #11217: Append problem with webkit
  • #11291: Cloning XMLDoc’s with HTML5 nodeName’s breaks on IE
  • #11323: script tags with type=”text/ecmascript” leak into the DOM
  • #11356: safeFragment memory leak

Misc

  • #10952: .fired() doesn’t work on Callbacks object when it is flagged with “once”
  • #11257: Wrong path to source files in test suite if PHP missing

Queue

  • #10967: .promise() does not attach methods onto target

Support

  • #7986: Bug in $.support.boxModel if page has DIV-element CSS
  • #11048: Support Tests affect layout for positioned elements in IE6-9
  • #11337: Bug in $.support.reliableMarginRight

Traversing

  • #11370: $(‘<div>’).siblings() throws exception