Bug 131859

Summary: Web Inspector: Opening a CSS file from the resources tab with long lines throws an exception, freezes inspector
Product: WebKit Reporter: Jonathan Wells <jonowells>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Critical CC: graouts, joepeck, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.9   
Attachments:
Description Flags
Reduction of issue none

Description Jonathan Wells 2014-04-18 14:54:35 PDT
Created attachment 229676 [details]
Reduction of issue

CSS files with lines with over 500 characters in them (whitespace, non-whitespace)  will freeze inspector and throw this exception: 

[Error] TypeError: undefined is not an object (evaluating 'state.stack.length')
	runInOp (codemirror.js, line 1972)
	operation (codemirror.js, line 4216)
	string (TextEditor.js, line 140)
	_populateWithContent (SourceCodeTextEditor.js, line 358)
	_contentAvailable (SourceCodeTextEditor.js, line 374)
	(anonymous function) ([native code], line 0)
	servicePendingContentRequests (SourceCode.js, line 238)
	_processContent (SourceCode.js, line 258)
	(anonymous function) ([native code], line 0)
	dispatch (InspectorBackend.js, line 231)
	dispatchNextQueuedMessageFromBackend (MessageDispatcher.js, line 31)
	(anonymous function) ([native code], line 0)

To reproduce:
1. Open the attached file resources.webarchive.
2. Open the inspector and navigate to Resources.
3. Open 2_breaks.css. (throws the exception)
4. Open 3_finally.css.
5. File doesn't load, wheel spins.
Comment 1 Radar WebKit Bug Importer 2014-04-18 14:54:54 PDT
<rdar://problem/16663653>
Comment 2 Jonathan Wells 2014-04-24 15:42:19 PDT
Fixed in https://bugs.webkit.org/show_bug.cgi?id=132090