Bug 220624 - Propagate explicit directionality into the Inspector DOM view
Summary: Propagate explicit directionality into the Inspector DOM view
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P3 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-14 06:24 PST by Sam Sneddon [:gsnedders]
Modified: 2021-01-21 06:25 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Sneddon [:gsnedders] 2021-01-14 06:24:43 PST
From Bug 220241:

> There's probably a strong argument that if the page has <span dir=rtl>foo</span> then we want to end up with <span class="html-text-node" dir=rtl>foo</span> in the Inspector, rather than using auto there.

In short, if the page has an explicitly defined directionality we almost certainly want to reuse that.

Even more generally, we may just want to explicitly use the same directionality as the source element, using something like element.matches(":dir(ltr)") ? "ltr" : "rtl", though this would add a dependency on bug 64861. This is _probably_ the best fix, because it means we end up with the same directionality in every case. Adding a depends-on for that, given I think it is what we should do?

I'm not totally sure what we want to do about attribute values here. Maybe always give them dir=auto?
Comment 1 Ryosuke Niwa 2021-01-14 09:45:44 PST
The computed value of direction property can be used. No need to rely on :dir. in fact, that would be wrong because :dir by definition will ignore CSS based directionality changes. Furthermore, Web Inspector backend uses C++ code to figure out the directionality of text. No need to rely on any real web API.
Comment 2 Radar WebKit Bug Importer 2021-01-21 06:25:13 PST
<rdar://problem/73450217>