Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7800a5152b1f3b4e15d7063a314ce5383c495b7e
      
https://github.com/WebKit/WebKit/commit/7800a5152b1f3b4e15d7063a314ce5383c495b7e
  Author: Tyler Wilcock <[email protected]>
  Date:   2026-09-05 (Sat, 05 Sep 2026)

  Changed paths:
    M LayoutTests/accessibility-isolated-tree/TestExpectations
    M Source/WebCore/accessibility/AccessibilityRenderObject.cpp

  Log Message:
  -----------
  AX: In isolated tree mode, an empty text field's text markers point into its 
placeholder
https://bugs.webkit.org/show_bug.cgi?id=323507
rdar://186747687

Reviewed by Chris Fleizach.

A placeholder stands in for text the field doesn't have, rather than text it 
contains, but its
rendered text was collected into the isolated tree's text runs like any other 
text. For an empty
<input placeholder="text">, AXTextMarkerRangeForUIElement on the field resolved 
to the placeholder's
static text and reported a length of 4 with the string "text", where the live 
tree reports the field
itself. It also meant a text-marker walk over the document would read a 
placeholder as if it were
page content.

Stop collecting text runs for a text control's placeholder, so that an empty 
field with a
placeholder behaves the same as an empty field without one. A field that has a 
value is unaffected
either way, since the placeholder isn't rendered then.

* LayoutTests/accessibility-isolated-tree/TestExpectations:
Mark accessibility/text-markers-for-input-with-placeholder.html as passing.
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
(WebCore::isPlaceholderText):
(WebCore::AccessibilityRenderObject::textRuns):

Canonical link: https://commits.webkit.org/320571@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to