Bug 276533 - Web Inspector: Parse attributes added via editing the tag name
Summary: Web Inspector: Parse attributes added via editing the tag name
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: Safari Technology Preview
Hardware: All All
: P2 Normal
Assignee: Razvan Caliman
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-07-12 03:22 PDT by Vadim Makeev
Modified: 2024-07-29 09:50 PDT (History)
3 users (show)

See Also:


Attachments
Editing tag and atting attributes (373.10 KB, image/png)
2024-07-12 03:22 PDT, Vadim Makeev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim Makeev 2024-07-12 03:22:04 PDT
Created attachment 471876 [details]
Editing tag and atting attributes

## Problem

Adding an attribute in the DOM tree inside of the Inspect panel is unusually complicated. Given the developers’ experience in code editors, one would expect to double-click the tag name and start typing. Unfortunately, the attribute gets dismissed this way. It even gets repeated in the closing tag, which looks weird.

## Solution

Currently, there are two editing modes available:

1. When you double-click the tag name, the tag name editing mode is opened.
2. When you press the Enter key, the adding attribute mode is opened.

The inspector should differentiate between tag name editing and adding attribute mode based on whether the space is typed. Since tag names cannot contain spaces, it seems obvious.

Chrome DevTools does this: once you type a space, it goes to the adding attributes mode.

Ideally, pressing enter should open one and only editing mode to edit both the tag name and attributes. What is what is figured out via parsing for spaces.

## Extra information

Attached screenshot:

1. Editing a tag name via double-click
2. Adding an attribute via the Enter key
3. Editing a tag name to add an attribute
4. Adding an attribute via the context menu
Comment 1 Radar WebKit Bug Importer 2024-07-12 04:48:30 PDT
<rdar://problem/131607290>
Comment 2 Razvan Caliman 2024-07-22 10:16:58 PDT
Pull request: https://github.com/WebKit/WebKit/pull/31069
Comment 3 EWS 2024-07-29 09:50:08 PDT
Committed 281507@main (0b084355708b): <https://commits.webkit.org/281507@main>

Reviewed commits have been landed. Closing PR #31069 and removing active labels.