Bug 149506 - Web Inspector: Hitting ESC while editing element tag name leaves element in bad state
Summary: Web Inspector: Hitting ESC while editing element tag name leaves element in b...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-09-23 10:21 PDT by Matt Baker
Modified: 2015-09-28 15:04 PDT (History)
8 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (2.03 KB, patch)
2015-09-23 10:36 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.