Bug 174617 - WebDriver: add a javascript atom to get the visible text
Summary: WebDriver: add a javascript atom to get the visible text
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 184964 (view as bug list)
Depends on:
Blocks: gtk-webdriver
  Show dependency treegraph
 
Reported: 2017-07-18 00:44 PDT by Carlos Garcia Campos
Modified: 2024-03-13 11:26 PDT (History)
9 users (show)

See Also:


Attachments
Patch (38.93 KB, patch)
2022-02-04 06:13 PST, Carlos Garcia Campos
aperez: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2017-07-18 00:44:42 PDT
We are currently returning innerText with whitespaces cleaned, but the spec says we should return someting more complex, equivalent to what the selenium atoms do.

"Let rendered text be the result of performing implementation-specific steps that are exactly analogous to the result of a [[Call]] to bot.dom.getVisibleText, providing null as the this value, and element as the argument."

https://www.w3.org/TR/webdriver/#get-element-text
Comment 1 BJ Burg 2017-07-19 15:09:33 PDT
<rdar://problem/32307461>
Comment 2 Carlos Garcia Campos 2022-02-04 06:13:02 PST
Created attachment 450885 [details]
Patch
Comment 3 Carlos Garcia Campos 2022-02-04 06:14:06 PST
*** Bug 184964 has been marked as a duplicate of this bug. ***
Comment 4 Patrick Angle 2022-02-07 09:00:55 PST
Comment on attachment 450885 [details]
Patch

Approach looks go to me as well until we can move to JS Built-ins for these scripts.
Comment 5 Carlos Garcia Campos 2022-02-09 05:49:23 PST
Committed r289467 (247010@trunk): <https://commits.webkit.org/247010@trunk>