Bug 99729

Summary: Web Inspector: Invalid Regex in SASSSourceMapping/didRequestContent, breaks Support for Sass experiment
Product: WebKit Reporter: Damir Zekić <damirz>
Component: Web Inspector (Deprecated)Assignee: Alexander Pavlov (apavlov) <apavlov>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, keishi, loislo, pfeldman, pmuellr, vsevik, web-inspector-bugs, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch vsevik: review+

Damir Zekić
Reported 2012-10-18 09:45:55 PDT
To reproduce the issue: 1. Create a Sass file with last rule on line 180 or further 1. Compile Sass with debug-info 3. Load a document that references compiled CSS — the feature will be broken. Even Sass files with less than 180 and more than100 lines will display wrong line numbers be wrong. It seems that the regex on the following line replaces too much: var line = parseInt(decodeURI(match[2].replace(/(..)/g, "%$1")), 10); see http://trac.webkit.org/browser/trunk/Source/WebCore/inspector/front-end/SASSSourceMapping.js?rev=129862#L86 The regex replaces value like "3170" with "%31%70" which decodes to "1p" whereas "170" was intended. Decoding value like "%31%83" throws URIError. A simple fix seems to be to replace "/(..)/g" with "/(.)/".
Attachments
Patch (2.37 KB, patch)
2012-10-19 02:55 PDT, Alexander Pavlov (apavlov)
vsevik: review+
Alexander Pavlov (apavlov)
Comment 1 2012-10-19 02:55:37 PDT
Alexander Pavlov (apavlov)
Comment 2 2012-10-19 03:09:21 PDT
Note You need to log in before you can comment on or make changes to this bug.