Bug 180676

Summary: Web Inspector: Styles Redesign: tabbing on commented out property throws exception
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=180687
Attachments:
Description Flags
Patch
nvasilyev: review-, nvasilyev: commit-queue-
Patch
joepeck: review+, commit-queue: commit-queue-
[Animated GIF] With patch applied
none
Patch none

Description Joseph Pecoraro 2017-12-11 15:54:10 PST
Uncaught exception when attempting to tab through properties and there was a comment at the end

Test Page:
<style>
div {
    width: 400px;
    height: 400px;
    background: blue;
    /* text-align: center; */
}
</style>
<div></div>

Steps to Reproduce:
1. Inspect test page
2. Click "blue"
3. Tab
  => Exception

-------
Uncaught Exceptions:
 - TypeError: null is not an object (evaluating 'this._propertyViews[index].nameTextField.startEditing') (at SpreadsheetCSSStyleDeclarationEditor.js:200:57)
    spreadsheetCSSStyleDeclarationEditorFocusMoved @ SpreadsheetCSSStyleDeclarationEditor.js:200:57
    spreadsheetTextFieldDidCommit @ SpreadsheetStyleProperty.js:263:74
    _handleKeyDown @ SpreadsheetTextField.js:237:61
    _handleKeyDown @ [native code]
-------
Comment 1 Radar WebKit Bug Importer 2017-12-11 15:55:30 PST
<rdar://problem/35981058>
Comment 2 Nikita Vasilyev 2017-12-11 17:48:45 PST
Created attachment 329068 [details]
Patch

This also fixes Bug 180687 - REGRESSION (r225569): Web Inspector: Commented out properties aren't property highlighted
Comment 3 Nikita Vasilyev 2017-12-11 17:51:27 PST
Comment on attachment 329068 [details]
Patch

This doesn't address every case:

[Error] TypeError: null is not an object (evaluating 'lastProperty.valueTextField.startEditing')
	startEditingLastProperty (SpreadsheetCSSStyleDeclarationEditor.js:116)
	cssStyleDeclarationSectionStartEditingPreviousRule (SpreadsheetRulesStyleDetailsPanel.js:226)
	spreadsheetSelectorFieldDidChange (SpreadsheetCSSStyleDeclarationSection.js:172:83)
	_handleKeyDown (SpreadsheetSelectorField.js:113)
	_handleKeyDown
Comment 4 Nikita Vasilyev 2017-12-11 18:47:11 PST
Created attachment 329074 [details]
Patch
Comment 5 Nikita Vasilyev 2017-12-11 18:48:24 PST
Created attachment 329075 [details]
[Animated GIF] With patch applied
Comment 6 Joseph Pecoraro 2018-01-19 11:49:03 PST
Comment on attachment 329074 [details]
Patch

r=me
Comment 7 WebKit Commit Bot 2018-01-19 11:50:41 PST
Comment on attachment 329074 [details]
Patch

Rejecting attachment 329074 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'apply-attachment', '--no-update', '--non-interactive', 329074, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
StyleDeclarationEditor.js
Hunk #3 succeeded at 254 (offset 1 line).
patching file Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js
Hunk #1 succeeded at 57 (offset 2 lines).
Hunk #2 FAILED at 173.
1 out of 2 hunks FAILED -- saving rejects to file Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js.rej

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Joseph Pecoraro']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.webkit.org/results/6138604
Comment 8 Nikita Vasilyev 2018-01-19 12:31:53 PST
Created attachment 331771 [details]
Patch

Rebaselined. I removed the CSS changes since they're already committed (Bug 180687 - REGRESSION (r225569): Web Inspector: Commented out properties aren't property highlighted).
Comment 9 WebKit Commit Bot 2018-01-19 13:18:24 PST
The commit-queue encountered the following flaky tests while processing attachment 331771 [details]:

imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-a-bitrate.html bug 181669 (authors: cdumez@apple.com and jer.noble@apple.com)
The commit-queue is continuing to process your patch.
Comment 10 WebKit Commit Bot 2018-01-19 13:18:48 PST
The commit-queue encountered the following flaky tests while processing attachment 331771 [details]:

http/tests/xmlhttprequest/access-control-and-redirects.html bug 181878 (authors: aa@chromium.org, rniwa@webkit.org, and youennf@gmail.com)
The commit-queue is continuing to process your patch.
Comment 11 WebKit Commit Bot 2018-01-19 13:37:04 PST
Comment on attachment 331771 [details]
Patch

Clearing flags on attachment: 331771

Committed r227232: <https://trac.webkit.org/changeset/227232>
Comment 12 WebKit Commit Bot 2018-01-19 13:37:06 PST
All reviewed patches have been landed.  Closing bug.