tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

12a-quartz-prefer-named-dest-over-uri.patch (1969B)


      1 # HG changeset patch
      2 # User Jonathan Kew <jkew@mozilla.com>
      3 # Date 1716990004 -3600
      4 #      Wed May 29 14:40:04 2024 +0100
      5 # Node ID b1e3be6e99abd59d94a1eac4b117d6329282b229
      6 # Parent  5af7c937b615aa238ce6629d7ec46af5ca17ec5b
      7 Bug 1896076 - patch 3 - In cairo-quartz-surface, prefer to use link's DEST rather than URI if both are present.
      8 
      9 diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
     10 --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
     11 +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
     12 @@ -2223,18 +2223,18 @@ static cairo_int_status_t
     13            in the link attributes. */
     14         CFURLRef url = NULL;
     15         CFStringRef name = NULL;
     16 -        if (link_attrs.uri && *link_attrs.uri)
     17 +        if (link_attrs.dest && *link_attrs.dest)
     18 +            name = CFStringCreateWithBytes (kCFAllocatorDefault,
     19 +                                            (const UInt8 *) link_attrs.dest,
     20 +                                            strlen (link_attrs.dest),
     21 +                                            kCFStringEncodingUTF8,
     22 +                                            FALSE);
     23 +        else if (link_attrs.uri && *link_attrs.uri)
     24             url = CFURLCreateWithBytes (NULL,
     25                                         (const UInt8 *) link_attrs.uri,
     26                                         strlen (link_attrs.uri),
     27                                         kCFStringEncodingUTF8,
     28                                         NULL);
     29 -        else if (link_attrs.dest && *link_attrs.dest)
     30 -            name = CFStringCreateWithBytes (kCFAllocatorDefault,
     31 -                                            (const UInt8 *) link_attrs.dest,
     32 -                                            strlen (link_attrs.dest),
     33 -                                            kCFStringEncodingUTF8,
     34 -                                            FALSE);
     35         else /* silently ignore link that doesn't have a usable target */
     36             goto cleanup;