Bug 263496 - Fix Range.getClientRects() to include full grapheme clusters
Summary: Fix Range.getClientRects() to include full grapheme clusters
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2023-10-21 06:10 PDT by Ahmad Saleem
Modified: 2023-11-06 19:22 PST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmad Saleem 2023-10-21 06:10:18 PDT
Hi Team,

While going through Blink's commit, I came across another test failing in Safari Technology Preview 181 while passing in Chrome Canary 120. NOTE: It also fails in Firefox Nightly 120.

Blink Commit: https://chromium.googlesource.com/chromium/src.git/+/0bac6c9ccc129eaa0a9c209f5f13466fe087ca7c

Test Case (took from 'source.chromium.org'): https://jsfiddle.net/5Lbgt8nf/show

Just raising so we can track it and fix it in future.

Thanks!
Comment 1 Radar WebKit Bug Importer 2023-10-28 06:11:13 PDT
<rdar://problem/117625675>
Comment 2 Karl Dubost 2023-11-06 19:22:49 PST
The tests starts failing for Firefox, Safari for DOMRect.width

Now the question is what is right. 

The tests are trying these

  testGrapheme,
  [
    ['Latin Combining Diacritical Marks U+301E at start',
    'áe',
    0,
    2],
    [
      'Latin Combining Diacritical Marks U+301E at mid',
      'eáe',
      1,
      3
    ],
    [
      'Latin Combining Diacritical Marks U+301E at end',
      'eá',
      1,
      3
    ],
    [
      'Arabic Fatha U+064E at start',
      'وَي',
      0,
      2
    ],
    [
      'Arabic Fatha U+064E at mid',
      'يوَي',
      1,
      3
    ],
    [
      'Arabic Fatha U+064E at end',
      'يوَ',
      1,
      3
    ],
  ]


Actual:
{
  "x": 0,
  "y": 20.800003051757812,
  "width": 0,
  "height": 16,
  "top": 20.800003051757812,
  "right": 0,
  "bottom": 36.80000305175781,
  "left": 0
}

Expected:
{
  "x": 0,
  "y": 20.800003051757812,
  "width": 7.100006103515625,
  "height": 16,
  "top": 20.800003051757812,
  "right": 7.100006103515625,
  "bottom": 36.80000305175781,
  "left": 0
}


Probably there are missing WPT tests for this.