Commit 7008f4c4 authored by Martin Robinson's avatar Martin Robinson Committed by Commit Bot

Round Windows and AuraLinux accessibility text attribute font sizes to 0.5 points

This produces a better experience for users by giving them a general
idea of the size of the font without subjecting them to a long decimal
number.

Bug: 1004771
Change-Id: I83d2ad8a60f2427eefe2ec86e4cdf1a798976c80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814931
Commit-Queue: Martin Robinson <mrobinson@igalia.com>
Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701111}
parent 600a77f6
......@@ -236,6 +236,10 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityCSSFontFamily) {
RunCSSTest(FILE_PATH_LITERAL("font-family.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityCSSFontSize) {
RunCSSTest(FILE_PATH_LITERAL("font-size.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest,
AccessibilityCSSDisplayToNone) {
RunCSSTest(FILE_PATH_LITERAL("display-to-none.html"));
......
[document web] size=7.5pt size=8.5pt size=9pt size=10pt size=10.5pt size=11.5pt size=15pt size=30pt size=37.5pt size=75pt size=10pt size=11pt size=12pt size=13pt size=14pt size=15pt size=20pt size=40pt size=50pt size=100pt
++[paragraph] size=7.5pt
++++[text] name='10.2340920823px' size=7.5pt
++[paragraph] size=7.5pt
++++[text] name='10px' size=7.5pt
++[paragraph] size=8.5pt
++++[text] name='11px' size=8.5pt
++[paragraph] size=9pt
++++[text] name='12px' size=9pt
++[paragraph] size=10pt
++++[text] name='13px' size=10pt
++[paragraph] size=10.5pt
++++[text] name='14px' size=10.5pt
++[paragraph] size=11.5pt
++++[text] name='15px' size=11.5pt
++[paragraph] size=15pt
++++[text] name='20px' size=15pt
++[paragraph] size=30pt
++++[text] name='40px' size=30pt
++[paragraph] size=37.5pt
++++[text] name='50px' size=37.5pt
++[paragraph] size=75pt
++++[text] name='100px' size=75pt
++[paragraph] size=10pt
++++[text] name='10.2340920823pt' size=10pt
++[paragraph] size=10pt
++++[text] name='10pt' size=10pt
++[paragraph] size=11pt
++++[text] name='11pt' size=11pt
++[paragraph] size=12pt
++++[text] name='12pt' size=12pt
++[paragraph] size=13pt
++++[text] name='13pt' size=13pt
++[paragraph] size=14pt
++++[text] name='14pt' size=14pt
++[paragraph] size=15pt
++++[text] name='15pt' size=15pt
++[paragraph] size=20pt
++++[text] name='20pt' size=20pt
++[paragraph] size=40pt
++++[text] name='40pt' size=40pt
++[paragraph] size=50pt
++++[text] name='50pt' size=50pt
++[paragraph] size=100pt
++++[text] name='100pt' size=100pt
rootWebArea fontSize=16.00
++genericContainer ignored fontSize=16.00
++++paragraph fontSize=10.23
++++++staticText name='10.2340920823px' fontSize=10.23
++++++++inlineTextBox name='10.2340920823px'
++++paragraph fontSize=10.00
++++++staticText name='10px' fontSize=10.00
++++++++inlineTextBox name='10px'
++++paragraph fontSize=11.00
++++++staticText name='11px' fontSize=11.00
++++++++inlineTextBox name='11px'
++++paragraph fontSize=12.00
++++++staticText name='12px' fontSize=12.00
++++++++inlineTextBox name='12px'
++++paragraph fontSize=13.00
++++++staticText name='13px' fontSize=13.00
++++++++inlineTextBox name='13px'
++++paragraph fontSize=14.00
++++++staticText name='14px' fontSize=14.00
++++++++inlineTextBox name='14px'
++++paragraph fontSize=15.00
++++++staticText name='15px' fontSize=15.00
++++++++inlineTextBox name='15px'
++++paragraph fontSize=20.00
++++++staticText name='20px' fontSize=20.00
++++++++inlineTextBox name='20px'
++++paragraph fontSize=40.00
++++++staticText name='40px' fontSize=40.00
++++++++inlineTextBox name='40px'
++++paragraph fontSize=50.00
++++++staticText name='50px' fontSize=50.00
++++++++inlineTextBox name='50px'
++++paragraph fontSize=100.00
++++++staticText name='100px' fontSize=100.00
++++++++inlineTextBox name='100px'
++++paragraph fontSize=13.65
++++++staticText name='10.2340920823pt' fontSize=13.65
++++++++inlineTextBox name='10.2340920823pt'
++++paragraph fontSize=13.33
++++++staticText name='10pt' fontSize=13.33
++++++++inlineTextBox name='10pt'
++++paragraph fontSize=14.67
++++++staticText name='11pt' fontSize=14.67
++++++++inlineTextBox name='11pt'
++++paragraph fontSize=16.00
++++++staticText name='12pt' fontSize=16.00
++++++++inlineTextBox name='12pt'
++++paragraph fontSize=17.33
++++++staticText name='13pt' fontSize=17.33
++++++++inlineTextBox name='13pt'
++++paragraph fontSize=18.67
++++++staticText name='14pt' fontSize=18.67
++++++++inlineTextBox name='14pt'
++++paragraph fontSize=20.00
++++++staticText name='15pt' fontSize=20.00
++++++++inlineTextBox name='15pt'
++++paragraph fontSize=26.67
++++++staticText name='20pt' fontSize=26.67
++++++++inlineTextBox name='20pt'
++++paragraph fontSize=53.33
++++++staticText name='40pt' fontSize=53.33
++++++++inlineTextBox name='40pt'
++++paragraph fontSize=66.67
++++++staticText name='50pt' fontSize=66.67
++++++++inlineTextBox name='50pt'
++++paragraph fontSize=133.33
++++++staticText name='100pt' fontSize=133.33
++++++++inlineTextBox name='100pt'
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE font-size:7.5pt font-size:8.5pt font-size:9pt font-size:10pt font-size:10.5pt font-size:11.5pt font-size:15pt font-size:30pt font-size:37.5pt font-size:75pt font-size:10pt font-size:11pt font-size:12pt font-size:13pt font-size:14pt font-size:15pt font-size:20pt font-size:40pt font-size:50pt font-size:100pt
++IA2_ROLE_PARAGRAPH font-size:7.5pt
++++ROLE_SYSTEM_STATICTEXT name='10.2340920823px' font-size:7.5pt
++IA2_ROLE_PARAGRAPH font-size:7.5pt
++++ROLE_SYSTEM_STATICTEXT name='10px' font-size:7.5pt
++IA2_ROLE_PARAGRAPH font-size:8.5pt
++++ROLE_SYSTEM_STATICTEXT name='11px' font-size:8.5pt
++IA2_ROLE_PARAGRAPH font-size:9pt
++++ROLE_SYSTEM_STATICTEXT name='12px' font-size:9pt
++IA2_ROLE_PARAGRAPH font-size:10pt
++++ROLE_SYSTEM_STATICTEXT name='13px' font-size:10pt
++IA2_ROLE_PARAGRAPH font-size:10.5pt
++++ROLE_SYSTEM_STATICTEXT name='14px' font-size:10.5pt
++IA2_ROLE_PARAGRAPH font-size:11.5pt
++++ROLE_SYSTEM_STATICTEXT name='15px' font-size:11.5pt
++IA2_ROLE_PARAGRAPH font-size:15pt
++++ROLE_SYSTEM_STATICTEXT name='20px' font-size:15pt
++IA2_ROLE_PARAGRAPH font-size:30pt
++++ROLE_SYSTEM_STATICTEXT name='40px' font-size:30pt
++IA2_ROLE_PARAGRAPH font-size:37.5pt
++++ROLE_SYSTEM_STATICTEXT name='50px' font-size:37.5pt
++IA2_ROLE_PARAGRAPH font-size:75pt
++++ROLE_SYSTEM_STATICTEXT name='100px' font-size:75pt
++IA2_ROLE_PARAGRAPH font-size:10pt
++++ROLE_SYSTEM_STATICTEXT name='10.2340920823pt' font-size:10pt
++IA2_ROLE_PARAGRAPH font-size:10pt
++++ROLE_SYSTEM_STATICTEXT name='10pt' font-size:10pt
++IA2_ROLE_PARAGRAPH font-size:11pt
++++ROLE_SYSTEM_STATICTEXT name='11pt' font-size:11pt
++IA2_ROLE_PARAGRAPH font-size:12pt
++++ROLE_SYSTEM_STATICTEXT name='12pt' font-size:12pt
++IA2_ROLE_PARAGRAPH font-size:13pt
++++ROLE_SYSTEM_STATICTEXT name='13pt' font-size:13pt
++IA2_ROLE_PARAGRAPH font-size:14pt
++++ROLE_SYSTEM_STATICTEXT name='14pt' font-size:14pt
++IA2_ROLE_PARAGRAPH font-size:15pt
++++ROLE_SYSTEM_STATICTEXT name='15pt' font-size:15pt
++IA2_ROLE_PARAGRAPH font-size:20pt
++++ROLE_SYSTEM_STATICTEXT name='20pt' font-size:20pt
++IA2_ROLE_PARAGRAPH font-size:40pt
++++ROLE_SYSTEM_STATICTEXT name='40pt' font-size:40pt
++IA2_ROLE_PARAGRAPH font-size:50pt
++++ROLE_SYSTEM_STATICTEXT name='50pt' font-size:50pt
++IA2_ROLE_PARAGRAPH font-size:100pt
++++ROLE_SYSTEM_STATICTEXT name='100pt' font-size:100pt
<!--
@BLINK-ALLOW:fontSize=*
@WIN-ALLOW:font-size:*
@AURALINUX-ALLOW:size=*
-->
<!DOCTYPE html>
<html>
<body>
<p style="font-size: 10.2340920823px">10.2340920823px</p>
<p style="font-size: 10px">10px</p>
<p style="font-size: 11px">11px</p>
<p style="font-size: 12px">12px</p>
<p style="font-size: 13px">13px</p>
<p style="font-size: 14px">14px</p>
<p style="font-size: 15px">15px</p>
<p style="font-size: 20px">20px</p>
<p style="font-size: 40px">40px</p>
<p style="font-size: 50px">50px</p>
<p style="font-size: 100px">100px</p>
<p style="font-size: 10.2340920823pt">10.2340920823pt</p>
<p style="font-size: 10pt">10pt</p>
<p style="font-size: 11pt">11pt</p>
<p style="font-size: 12pt">12pt</p>
<p style="font-size: 13pt">13pt</p>
<p style="font-size: 14pt">14pt</p>
<p style="font-size: 15pt">15pt</p>
<p style="font-size: 20pt">20pt</p>
<p style="font-size: 40pt">40pt</p>
<p style="font-size: 50pt">50pt</p>
<p style="font-size: 100pt">100pt</p>
</body>
</html>
......@@ -1776,6 +1776,10 @@ ui::TextAttributeList AXPlatformNodeBase::ComputeTextAttributes() const {
// We assume that there are 96 pixels per inch on a standard display.
// TODO(nektar): Figure out the current value of pixels per inch.
float points = font_size * 72.0 / 96.0;
// Round to the nearest 0.5 points.
points = std::round(points * 2.0) / 2.0;
attributes.push_back(
std::make_pair("font-size", base::NumberToString(points) + "pt"));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment