<?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>257674</bug_id>
          
          <creation_ts>2023-06-02 23:29:28 -0700</creation_ts>
          <short_desc>import-w3c-tests, -s, and web-platform-tests/css/selectors</short_desc>
          <delta_ts>2023-08-21 08:14:53 -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>Tools / Tests</component>
          <version>WebKit Nightly Build</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=259750</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=260349</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne van Kesteren">annevk</reporter>
          <assigned_to name="Sam Sneddon [:gsnedders]">gsnedders</assigned_to>
          <cc>clopez</cc>
    
    <cc>gsnedders</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1959673</commentid>
    <comment_count>0</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-06-02 23:29:28 -0700</bug_when>
    <thetext>When I run

    import-w3c-tests web-platform-tests/css/selectors --clear-dest-dir -a -l -s ../../Documents/GitHub.nosync

it ends up removing 6 files

    LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-default-ns-001-expected.html

among them. That doesn&apos;t appear to be the correct behavior as those files are needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1959674</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-06-02 23:29:39 -0700</bug_when>
    <thetext>&lt;rdar://problem/110201843&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1959699</commentid>
    <comment_count>2</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-06-03 10:40:27 -0700</bug_when>
    <thetext>I&apos;m not sure if we want to track this separately, but for the same PR I also ended up synchronizing web-platform-tests/css/cssom and I noticed it started making changes to some files of web-platform-tests/css/cssom-view.

This tool is quite broken. :-(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1959957</commentid>
    <comment_count>3</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2023-06-05 14:42:41 -0700</bug_when>
    <thetext>(In reply to Anne van Kesteren from comment #2)
&gt; I&apos;m not sure if we want to track this separately, but for the same PR I also
&gt; ended up synchronizing web-platform-tests/css/cssom and I noticed it started
&gt; making changes to some files of web-platform-tests/css/cssom-view.
&gt; 
&gt; This tool is quite broken. :-(

Please track that separately, that sounds like a totally separate set of bugs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1960564</commentid>
    <comment_count>4</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-06-08 09:31:33 -0700</bug_when>
    <thetext>Filed bug 257855.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1963359</commentid>
    <comment_count>5</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2023-06-23 10:59:01 -0700</bug_when>
    <thetext>(In reply to Anne van Kesteren from comment #0)
&gt; When I run
&gt; 
&gt;     import-w3c-tests web-platform-tests/css/selectors --clear-dest-dir -a -l
&gt; -s ../../Documents/GitHub.nosync
&gt; 
&gt; it ends up removing 6 files
&gt; 
&gt;    
&gt; LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-default-ns-001-
&gt; expected.html
&gt; 
&gt; among them. That doesn&apos;t appear to be the correct behavior as those files
&gt; are needed.

The upstream /css/selectors/is-default-ns-001.html contains:

&lt;link rel=&quot;match&quot; href=&quot;/css/reference/blank.html&quot;&gt;

So it still has a ref, so it&apos;s surprising that it doesn&apos;t get imported successfully.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1969285</commentid>
    <comment_count>6</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2023-08-02 09:51:27 -0700</bug_when>
    <thetext>I can&apos;t reproduce this:

```
./Tools/Scripts/import-w3c-tests web-platform-tests/css/selectors --clear-dest-dir -a -t
```

Results in:

```
On branch main
Your branch is up to date with &apos;origin/main&apos;.

Changes not staged for commit:
  (use &quot;git add &lt;file&gt;...&quot; to update what will be committed)
  (use &quot;git restore &lt;file&gt;...&quot; to discard changes in working directory)
	modified:   LayoutTests/imported/w3c/resources/import-expectations.json
	modified:   LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/user-action-pseudo-classes-in-has.html
	modified:   LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/w3c-import.log
	modified:   LayoutTests/imported/w3c/web-platform-tests/css/selectors/modal-pseudo-class.html
	modified:   LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log

Untracked files:
  (use &quot;git add &lt;file&gt;...&quot; to include in what will be committed)
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/dir-pseudo-update-document-element-expected.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/dir-pseudo-update-document-element-ref.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/dir-pseudo-update-document-element.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/crashtests/
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/is-pseudo-containing-sibling-relationship-in-has.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/negated-nth-child-when-ancestor-changes-expected.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/negated-nth-child-when-ancestor-changes-ref.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/negated-nth-child-when-ancestor-changes.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/negated-nth-last-child-when-ancestor-changes-expected.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/negated-nth-last-child-when-ancestor-changes-ref.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/negated-nth-last-child-when-ancestor-changes.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/not-pseudo-containing-sibling-relationship-in-has.html

no changes added to commit (use &quot;git add&quot; and/or &quot;git commit -a&quot;)
```

Note there&apos;s no deleted files.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1969346</commentid>
    <comment_count>7</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2023-08-02 16:20:29 -0700</bug_when>
    <thetext>This still fails to reproduce with `--clear-dest-dir` corrected to `--clean-dest-dir` (bug 259750).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1971790</commentid>
    <comment_count>8</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2023-08-17 04:08:20 -0700</bug_when>
    <thetext>Anne asked if this reproduced with `-s` specifically, and:

```
./Tools/Scripts/import-w3c-tests web-platform-tests/css/selectors --clean-dest-dir -a -t -s ~/projects/wpt
```

Results in:

```
On branch main
Your branch is up to date with &apos;origin/main&apos;.

Changes not staged for commit:
  (use &quot;git add/rm &lt;file&gt;...&quot; to update what will be committed)
  (use &quot;git restore &lt;file&gt;...&quot; to discard changes in working directory)
	modified:   LayoutTests/imported/w3c/resources/import-expectations.json
	modified:   LayoutTests/imported/w3c/resources/resource-files.json
	deleted:    LayoutTests/imported/w3c/web-platform-tests/css/selectors/dir-pseudo-on-input-element-expected.txt
	modified:   LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/user-action-pseudo-classes-in-has.html
	modified:   LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/w3c-import.log
	deleted:    LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-default-ns-001-expected.html
	deleted:    LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-default-ns-002-expected.html
	deleted:    LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-default-ns-003-expected.html
	modified:   LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-where-error-recovery.html
	modified:   LayoutTests/imported/w3c/web-platform-tests/css/selectors/is-where-parsing.html
	modified:   LayoutTests/imported/w3c/web-platform-tests/css/selectors/modal-pseudo-class.html
	deleted:    LayoutTests/imported/w3c/web-platform-tests/css/selectors/not-default-ns-001-expected.html
	deleted:    LayoutTests/imported/w3c/web-platform-tests/css/selectors/not-default-ns-002-expected.html
	deleted:    LayoutTests/imported/w3c/web-platform-tests/css/selectors/not-default-ns-003-expected.html
	modified:   LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has-disallow-nesting-has-inside-has.html
	modified:   LayoutTests/imported/w3c/web-platform-tests/css/selectors/parsing/parse-has.html
	modified:   LayoutTests/imported/w3c/web-platform-tests/css/selectors/w3c-import.log

Untracked files:
  (use &quot;git add &lt;file&gt;...&quot; to include in what will be committed)
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/dir-pseudo-update-document-element-expected.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/dir-pseudo-update-document-element-ref.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/dir-pseudo-update-document-element.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/has-sibling-chrome-crash.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/crashtests/
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/is-pseudo-containing-sibling-relationship-in-has.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/negated-nth-child-when-ancestor-changes-expected.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/negated-nth-child-when-ancestor-changes-ref.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/negated-nth-child-when-ancestor-changes.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/negated-nth-last-child-when-ancestor-changes-expected.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/negated-nth-last-child-when-ancestor-changes-ref.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/negated-nth-last-child-when-ancestor-changes.html
	LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/not-pseudo-containing-sibling-relationship-in-has.html

no changes added to commit (use &quot;git add&quot; and/or &quot;git commit -a&quot;)
```

So… yes, it does. Well, that&apos;s cursed. That it manages to delete files in the simpler codepath but not the complex one seems deeply cursed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1971793</commentid>
    <comment_count>9</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2023-08-17 04:29:46 -0700</bug_when>
    <thetext>Ah, there&apos;s a bunch of errors like:

WARNING: /Users/gsnedders/projects/wpt/css/reference/blank.html not found. Possible error in the test.

So we&apos;re resolving absolute URLs against the wrong base directory.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1971795</commentid>
    <comment_count>10</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2023-08-17 04:44:27 -0700</bug_when>
    <thetext>Bug 200717 seems to have deliberately have implemented this differing behaviour with `-s`; see `test2.html` and `test3.html` in https://github.com/WebKit/WebKit/blob/6c660bb7b4f5b27281db488bcb8890cee00a1f0b/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py#L573-L593

Carlos, do you remember why you implemented this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1971798</commentid>
    <comment_count>11</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2023-08-17 05:00:50 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/16787</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1972376</commentid>
    <comment_count>12</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-08-21 08:14:51 -0700</bug_when>
    <thetext>Committed 267087@main (c2f1b3775319): &lt;https://commits.webkit.org/267087@main&gt;

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

    </bug>

</bugzilla>