<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>262488</bug_id>
          
          <creation_ts>2023-10-02 09:37:28 -0700</creation_ts>
          <short_desc>Simplify range mapping computation in SVGTextQuery/SVGInlineTextBox</short_desc>
          <delta_ts>2023-10-17 14:00:06 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=261651</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>karlcow</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1981775</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-10-02 09:37:28 -0700</bug_when>
    <thetext>Simplify range mapping computation in SVGTextQuery/SVGInlineTextBox

Blink Merge: https://src.chromium.org/viewvc/blink?view=revision&amp;revision=193017

_________

bool SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment&amp; fragment, unsigned&amp; startPosition, unsigned&amp; endPosition) const
{
    unsigned fragmentOffsetInBox = fragment.characterOffset - start();

    // Compute positions relative to the fragment.
    startPosition -= fragmentOffsetInBox;
    endPosition -= fragmentOffsetInBox;

    // Intersect with the fragment range.
    startPosition = std::max&lt;unsigned&gt;(startPosition, 0);
    endPosition = std::min&lt;unsigned&gt;(endPosition, fragment.length);

    return startPosition &lt; endPosition;
}

________

Just wanted to raise.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1981923</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-10-02 17:55:18 -0700</bug_when>
    <thetext>This simplification require pre-requisite to make SVG Text code to respect RTL etc.

By doing 1-1 merge as below PR, it will leads to two failures:

https://github.com/WebKit/WebKit/pull/18514

Failing tests:

imported/mozilla/svg/text/textpath-selection.svg
imported/w3c/web-platform-tests/css/css-pseudo/textpath-selection-011.html

^ Both are genuine failures.

I am letting my PR run through EWS fully to document failures (if any else) but I will look into further future merges and see what else I can do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1983707</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-10-09 09:38:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/116683897&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1985677</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-10-17 14:00:04 -0700</bug_when>
    <thetext>Committed 269425@main (8e69bb72e0ee): &lt;https://commits.webkit.org/269425@main&gt;

Reviewed commits have been landed. Closing PR #18514 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>