Bug 96734 - Cannot select text within a label element that is linked to an input field
Summary: Cannot select text within a label element that is linked to an input field
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified OS X 10.6
: P2 Normal
Assignee: Nobody
URL: http://jsfiddle.net/FpcTz/
Keywords: BlinkMergeCandidate, InRadar
Depends on: 259558
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-14 01:27 PDT by ben
Modified: 2023-10-03 14:42 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ben 2012-09-14 01:27:48 PDT
1. Go to: http://jsfiddle.net/FpcTz/
2. Try and select the label text either by double clicking or dragging over some of it.

The selection is lost and focus jumps to the field next to it. This happens for text within label tags that is linked to an input via the 'for' attribute.
Comment 2 Ahmad Saleem 2022-10-29 17:43:39 PDT
(In reply to Ahmad Saleem from comment #1)
> This to merge following Blink Commit - 
> 
> https://src.chromium.org/viewvc/blink?view=revision&revision=174296
> 
> In Webkit GitHub source here:
> 
> https://github.com/WebKit/WebKit/blob/
> 51974bdf186d0771e79b230316ed0cddc5293f88/Source/WebCore/html/
> HTMLLabelElement.cpp#L136
> 
> ___
> 
> It fails following test - https://jsfiddle.net/9pznh8ak/show

I tried to merge this:

https://github.com/WebKit/WebKit/pull/5676

and the issue is:

```
        auto control = this->control();
```

If I try to change it to RefPtr then it leads to build failures. If I don't then it compiles but crashes on following test:

imported/blink/fast/forms/label/detached-document.html
Comment 3 Ahmad Saleem 2022-12-02 16:08:25 PST
(In reply to Ahmad Saleem from comment #2)
> (In reply to Ahmad Saleem from comment #1)
> > This to merge following Blink Commit - 
> > 
> > https://src.chromium.org/viewvc/blink?view=revision&revision=174296
> > 
> > In Webkit GitHub source here:
> > 
> > https://github.com/WebKit/WebKit/blob/
> > 51974bdf186d0771e79b230316ed0cddc5293f88/Source/WebCore/html/
> > HTMLLabelElement.cpp#L136
> > 
> > ___
> > 
> > It fails following test - https://jsfiddle.net/9pznh8ak/show
> 
> I tried to merge this:
> 
> https://github.com/WebKit/WebKit/pull/5676
> 
> and the issue is:
> 
> ```
>         auto control = this->control();
> ```
> 
> If I try to change it to RefPtr then it leads to build failures. If I don't
> then it compiles but crashes on following test:
> 
> imported/blink/fast/forms/label/detached-document.html

While trying to find equivalent of "LocalFrame.h" header, it seems that Webkit has "Frame.h" as equivalent. I might try to add it and push it again in future but just wanted to comment so if someone else know, they can fix try it.
Comment 4 EWS 2023-04-26 11:15:49 PDT
Committed 263420@main (01527bde3937): <https://commits.webkit.org/263420@main>

Reviewed commits have been landed. Closing PR #12503 and removing active labels.
Comment 5 Radar WebKit Bug Importer 2023-04-26 11:16:24 PDT
<rdar://problem/108566491>
Comment 6 WebKit Commit Bot 2023-07-27 06:42:01 PDT
Re-opened since this is blocked by bug 259558
Comment 7 Alexey Proskuryakov 2023-07-27 20:17:13 PDT
New tracking radar:

rdar://113011484