Skip to content

Commit

Permalink
Cherry-pick a799925. rdar://problem/112973142
Browse files Browse the repository at this point in the history
    Unreviewed, reverting 263420@main.
    https://bugs.webkit.org/show_bug.cgi?id=259558

    'caused WPT regression in test *proxy-modifier-click-to-associated-element.tentative.html'*

    Reverted changeset:

    "Cannot select text within a label element that is linked to an input field"
    https://bugs.webkit.org/show_bug.cgi?id=96734
    https://commits.webkit.org/263420@main

    Canonical link: https://commits.webkit.org/266356@main
  • Loading branch information
webkit-commit-queue authored and MyahCobbs committed Aug 2, 2023
1 parent 781cdef commit bd66501
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 48 deletions.
10 changes: 0 additions & 10 deletions LayoutTests/fast/forms/label/label-selection-expected.txt

This file was deleted.

26 changes: 0 additions & 26 deletions LayoutTests/fast/forms/label/label-selection.html

This file was deleted.

1 change: 0 additions & 1 deletion LayoutTests/platform/ios/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,6 @@ fast/forms/input-readonly-focus.html [ Skip ]
fast/forms/input-readonly-select.html [ Skip ]
fast/forms/input-select-on-click.html [ Skip ]
fast/forms/input-step-as-double.html [ Skip ]
fast/forms/label/label-selection.html [ Skip ]
fast/forms/legend-overflow-hidden-hit-test.html [ Skip ]
fast/forms/listbox-deselect-scroll.html [ Skip ]
fast/forms/listbox-scrollbar-hit-test.html [ Skip ]
Expand Down
11 changes: 0 additions & 11 deletions Source/WebCore/html/HTMLLabelElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@
#include "Event.h"
#include "EventNames.h"
#include "FormListedElement.h"
#include "FrameSelection.h"
#include "HTMLFormControlElement.h"
#include "HTMLNames.h"
#include "LocalFrame.h"
#include "MouseEvent.h"
#include "SelectionRestorationMode.h"
#include "TypedElementDescendantIteratorInlines.h"
#include <wtf/IsoMallocInlines.h>
Expand Down Expand Up @@ -143,14 +140,6 @@ bool HTMLLabelElement::isEventTargetedAtInteractiveDescendants(Event& event) con
void HTMLLabelElement::defaultEventHandler(Event& event)
{
if (event.type() == eventNames().clickEvent && !m_processingClick) {
// If text of label element is selected, do not pass the event to control element.
// Note: a click event may be not a mouse event if created by document.createEvent().
if (event.isMouseEvent() && !downcast<MouseEvent>(event).isSimulated()) {
auto* frame = document().frame();
if (frame && frame->selection().selection().isRange())
return;
}

auto control = this->control();

// If we can't find a control or if the control received the click
Expand Down

0 comments on commit bd66501

Please sign in to comment.