Bug 206842 - WPT test importer only rewrites the first URL on <style> tags.
Summary: WPT test importer only rewrites the first URL on <style> tags.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Alberto Lopez Perez
URL:
Keywords: InRadar
Depends on:
Blocks: 207734
  Show dependency treegraph
 
Reported: 2020-01-27 13:27 PST by Carlos Alberto Lopez Perez
Modified: 2020-02-13 18:17 PST (History)
10 users (show)

See Also:


Attachments
Patch (7.30 KB, patch)
2020-01-27 14:03 PST, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2020-01-27 13:27:25 PST
When importing WPT tests, the WebKit WPT importer tries to rewrite any URL() reference inside the <style> tags of the ref-tests to fix issues related to moving the ref-test to a new directory.
But its currently only doing that for the first URL() reference it finds.

Example:

1) WPT test css/css-backgrounds/css-border-radius-002.html has as test reference css/css-backgrounds/reference/css-border-radius-ref-002.html 
2) WPT test importer imports css/css-backgrounds/reference/css-border-radius-ref-002.html as css/css-backgrounds/css-border-radius-002-expected.html 
3) Since the ref-test has been moved to a different directory, it tries to update relative urls() on the <style> tag:

Originally css-border-radius-ref-002.html had:
    <style type="text/css">
        .redSquare {
            position: absolute;
			left:50px;
            width: 100px;
            height: 100px;
			background-image:url(../support/yyy.png);
        }
		.greenSquare {
            position: absolute;
			left:50px;
            width: 100px;
            height: 100px;
			background-image:url(../support/yy.png);
        }
        .container {
            position: absolute;
        }
    </style>

Therefore, the style on css-border-radius-002-expected.html should have been rewrote as:
    <style type="text/css">
        .redSquare {
            position: absolute;
			left:50px;
            width: 100px;
            height: 100px;
			background-image:url(support/yyy.png);
        }
		.greenSquare {
            position: absolute;
			left:50px;
            width: 100px;
            height: 100px;
			background-image:url(support/yy.png);
        }
        .container {
            position: absolute;
        }
    </style>
    
    

The problem it is currently doing that only for the first URL (yyy.png) but not for the second (yy.png)
Comment 1 Carlos Alberto Lopez Perez 2020-01-27 14:03:17 PST
Created attachment 388905 [details]
Patch
Comment 2 WebKit Commit Bot 2020-01-28 06:25:57 PST
Comment on attachment 388905 [details]
Patch

Clearing flags on attachment: 388905

Committed r255236: <https://trac.webkit.org/changeset/255236>
Comment 3 WebKit Commit Bot 2020-01-28 06:25:59 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2020-01-28 06:26:12 PST
<rdar://problem/58953537>