Bug 149506

Summary: Web Inspector: Hitting ESC while editing element tag name leaves element in bad state
Product: WebKit Reporter: Matt Baker <mattbaker>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Matt Baker 2015-09-23 10:21:25 PDT
* SUMMARY
Hitting ESC while editing element tag name leaves element in bad state.

* STEPS TO REPRODUCE
1. Open Elements tab
2. Double-click the tag text for an element, such as a <div> (must not be a self-closing tag)
3. Enter a new element name, hit ESC to cancel
  => The opening tag name reverts to the original text, but the closing tag does not
Comment 1 Radar WebKit Bug Importer 2015-09-23 10:21:41 PDT
<rdar://problem/22821316>
Comment 2 Joseph Pecoraro 2015-09-23 10:36:52 PDT
Created attachment 261828 [details]
[PATCH] Proposed Fix
Comment 3 Matt Baker 2015-09-23 10:41:00 PDT
Comment on attachment 261828 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=261828&action=review

> Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:809
> +        let originalClosingTagTextContent = closingTagElement ? closingTagElement.textContent : "";

const originalClosingTagTextContent = ...
Comment 4 Joseph Pecoraro 2015-09-28 14:17:12 PDT
Comment on attachment 261828 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=261828&action=review

>> Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js:809
>> +        let originalClosingTagTextContent = closingTagElement ? closingTagElement.textContent : "";
> 
> const originalClosingTagTextContent = ...

Though true, we do this a lot and we haven't exactly standardized on this.

I tend to use const when assigning a literal primitive to give it a better name.

    const betterNameForBool = true;
    const minimumSizeOfSomething = 15;
    const defaultDisplayString = "–";

Maybe we should start using const more for cases like this.
Comment 5 WebKit Commit Bot 2015-09-28 15:04:00 PDT
Comment on attachment 261828 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 261828

Committed r190286: <http://trac.webkit.org/changeset/190286>
Comment 6 WebKit Commit Bot 2015-09-28 15:04:03 PDT
All reviewed patches have been landed.  Closing bug.