-
Notifications
You must be signed in to change notification settings - Fork 1.6k
AX: Add tests for RTL/LTR bidi text #46728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AX: Add tests for RTL/LTR bidi text #46728
Conversation
EWS run on current version of this PR (hash 0be54d7) |
EWS run on previous version of this PR (hash 0be54d7)
|
staticTextTextMarkerRange = staticText.textMarkerRangeForElement(staticText); | ||
output += expect("staticText.textMarkerRangeLength(staticTextTextMarkerRange)", "28"); | ||
|
||
output += expectRectWithVariance("staticText.boundsForRange(0, 28)", -1, -1, 188, 18, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expectRectWithVariance is good, but it still does feel like this test might tend to break if things shift by a couple of pixels.
Would it be possible to instead iterate over the characters and, using the bounds, just assert whether or not each index moved to the left or to the right?
0be54d7
to
7ebbb87
Compare
EWS run on previous version of this PR (hash 7ebbb87)
|
7ebbb87
to
a3dcd16
Compare
EWS run on previous version of this PR (hash a3dcd16) |
EWS run on previous version of this PR (hash dab773c)
|
dab773c
to
1a47eec
Compare
EWS run on previous version of this PR (hash 1a47eec) |
1a47eec
to
412b05d
Compare
EWS run on previous version of this PR (hash 412b05d) |
<meta charset="utf-8"> | ||
<script src="../../resources/js-test.js"></script> | ||
<script src="../../resources/accessibility-helper.js"></script> | ||
<style> | ||
.unicode-bidi-normal { | ||
unicode-bidi: normal; | ||
} | ||
.unicode-bidi-embed { | ||
unicode-bidi: embed; | ||
} | ||
.unicode-bidi-bidi-override { | ||
unicode-bidi: bidi-override; | ||
} | ||
.unicode-bidi-plaintext { | ||
unicode-bidi: plaintext; | ||
} | ||
.unicode-bidi-isolate { | ||
unicode-bidi: isolate; | ||
} | ||
.unicode-bidi-isolate-override { | ||
unicode-bidi: isolate-override; | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think typically in other accessibility layout tests, we don't indent things in the <head>
.
<meta charset="utf-8"> | ||
<script src="../../resources/js-test.js"></script> | ||
<script src="../../resources/accessibility-helper.js"></script> | ||
<style> | ||
.unicode-bidi-normal { | ||
unicode-bidi: normal; | ||
} | ||
.unicode-bidi-embed { | ||
unicode-bidi: embed; | ||
} | ||
.unicode-bidi-bidi-override { | ||
unicode-bidi: bidi-override; | ||
} | ||
.unicode-bidi-plaintext { | ||
unicode-bidi: plaintext; | ||
} | ||
.unicode-bidi-isolate { | ||
unicode-bidi: isolate; | ||
} | ||
.unicode-bidi-isolate-override { | ||
unicode-bidi: isolate-override; | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think typically in other accessibility layout tests, we don't indent things in the <head>
.
Your commit message (and PR description) needs to follow a very specific format, or else it will get rejected by the commit queue:
|
|
||
PASS: rangeLength === 28 | ||
PASS: maxBounds === 188 | ||
PASS: currentBounds > lastBounds === true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To better catch failures down the line, I wonder if each pass should print which character is being evaluated, in addition to whether this condition passes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better, how about just count the number of characters going each direction.
I'd like something along the lines of:
PASS: characters 0...20 are LTR
PASS: characters 20...26 are RTL
etc.
This test verifies that a combination of Arabic and English is read correctly by Accessibility, when using CSS unicode-bidi property. | ||
|
||
PASS: rangeLength === 28 | ||
PASS: maxBounds === 188 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe delete this line. It looks like it's failing on the bots because we don't get exactly the same number of pixels with and without ITM.
412b05d
to
4a93a5a
Compare
EWS run on previous version of this PR (hash 4a93a5a) |
4a93a5a
to
8625023
Compare
EWS run on previous version of this PR (hash 8625023) |
8625023
to
1d6fda0
Compare
EWS run on previous version of this PR (hash 1d6fda0) |
1d6fda0
to
34e6ce6
Compare
EWS run on previous version of this PR (hash 34e6ce6) |
34e6ce6
to
939c13f
Compare
EWS run on previous version of this PR (hash 939c13f) |
939c13f
to
540df70
Compare
EWS run on previous version of this PR (hash 540df70) |
540df70
to
47dbfb7
Compare
EWS run on previous version of this PR (hash 47dbfb7) |
47dbfb7
to
f6d2cd5
Compare
EWS run on previous version of this PR (hash f6d2cd5) |
Commit message contains (OOPS!), blocking PR #46728. Details: Build #23436 |
f6d2cd5
to
199a68d
Compare
EWS run on current version of this PR (hash 199a68d) |
https://bugs.webkit.org/show_bug.cgi?id=294460 rdar://153327595 Reviewed by Tyler Wilcock. Add tests for bidi text: English-Arabic and English-Hebrew. This test counts the number of LTR and RTL positions within strings based on textmarkers. There are six strings tested, each with a unique value applied to its unicode-bidi css property. * LayoutTests/accessibility/text-marker/text-marker-bidi-element-arabic-expected.txt: Added. * LayoutTests/accessibility/text-marker/text-marker-bidi-element-arabic.html: Added. * LayoutTests/accessibility/text-marker/text-marker-bidi-element-hebrew-expected.txt: Added. * LayoutTests/accessibility/text-marker/text-marker-bidi-element-hebrew.html: Added. * LayoutTests/platform/ios/TestExpectations: Canonical link: https://commits.webkit.org/296764@main
199a68d
to
c275e78
Compare
Committed 296764@main (c275e78): https://commits.webkit.org/296764@main Reviewed commits have been landed. Closing PR #46728 and removing active labels. |
c275e78
199a68d
🛠 playstation