Opened 12 years ago
Closed 12 years ago
#7082 closed bug (fixed)
Manipulation test incorrectly failing for old Webkit based Browsers
Reported by: | jitter | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.4.3 |
Component: | manipulation | Version: | 1.4.2 |
Keywords: | manipulation webkit regex | Cc: | |
Blocked by: | Blocking: |
Description
The manipulation test which checks if &#...; encoded entities are encoded properly, fails incorrectly for old Webkit based browsers.
These browsers properly encode the   (the innerHTML-property is set to a 1-character string which has charCode 160).
But this manipulation test is shown as failing for old Webkit browsers.
This has to do with an old Webkit-Bug (which is fixed since around spring 2009). In those older builds Webkit returned false for this simple test
/\s/.test('\xA0')
as Webkit failed to match with the \s character class escape.
I verified this for Safari 3.1.2 (525.21), Safari 3.2.3 (525.29), iPhone Safari 2.2.1 (Webkit 525.18.1) and S60 5.0 Browser (Webkit 525). But all browsers using those older Webkit versions are affected (Chrome < 2.x, ...)
So I guess changing the Regex-Test in Line 902 of test/unit/manipulations.js from
/^\s$|^ $/.test( space )
to
/^\xA0$|^ $/.test( space )
should fix this false-positive.
Fixed http://github.com/jquery/jquery/commit/88fc523c59465b28633de91f4c9e87b8364064b7