Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #10284 Ignore alternate stylesheets #10319

Merged
merged 1 commit into from Apr 6, 2016
Merged

Conversation

@mylainos
Copy link
Contributor

mylainos commented Mar 31, 2016

This change is Reviewable

@highfive
Copy link

highfive commented Mar 31, 2016

Heads up! This PR modifies the following files:

  • @jgraham: tests/wpt/metadata/MANIFEST.json, tests/wpt/web-platform-tests/html/semantics/links/linktypes/alternate-css-ref.html, tests/wpt/web-platform-tests/html/semantics/links/linktypes/alternate-css.html, tests/wpt/web-platform-tests/html/semantics/links/linktypes/preferred.css, tests/wpt/web-platform-tests/html/semantics/links/linktypes/alternate.css
  • @KiChjang: components/script/dom/htmllinkelement.rs
@KiChjang
Copy link
Member

KiChjang commented Mar 31, 2016

The change to MANIFEST.json looks very wrong; did you use ./mach create-wpt /path/to/test/files to create your test files?

@mylainos
Copy link
Contributor Author

mylainos commented Mar 31, 2016

Yes, I have used ./mach create-wpt --reftest tests/wpt/web-platform-tests/html/semantics/links/linktypes/alternate-css.html --reference tests/wpt/web-platform-tests/html/semantics/links/linktypes/alternate-css-ref.html

@jdm
Copy link
Member

jdm commented Mar 31, 2016

The manifest thing is a known issue and won't cause any problems being merged.

@mylainos
Copy link
Contributor Author

mylainos commented Apr 1, 2016

components/script/dom/htmllinkelement.rs, line 93 [r2] (raw file):
It may be better to do that :

let mut substrings = value.split(HTML_SPACE_CHARACTERS);
let mut substrings2 = substrings.clone();
substrings.any(|s| s.eq_ignore_ascii_case("stylesheet"))
&& !substrings2.any(|s| s.eq_ignore_ascii_case("alternate"))

Comments from the review on Reviewable.io

@bors-servo
Copy link
Contributor

bors-servo commented Apr 1, 2016

The latest upstream changes (presumably #10315) made this pull request unmergeable. Please resolve the merge conflicts.

@mylainos
Copy link
Contributor Author

mylainos commented Apr 1, 2016

There is a merge conflict in MANIFEST.json, what should I do ? I have error if I keep my changes or if I keep the new ones.

@jdm
Copy link
Member

jdm commented Apr 1, 2016

@mylainos It's usually easiest to keep the new changes and run ./mach test-wpt --manifest-update SKIP_TESTS.

@mylainos
Copy link
Contributor Author

mylainos commented Apr 1, 2016

There is a lot of errors like this one:

  ▶ TIMEOUT [expected OK] /2dcontext/compositing/2d.composite.canvas.destination-atop.html

  ▶ Unexpected subtest result in /2dcontext/compositing/2d.composite.canvas.destination-atop.html:
  └ NOTRUN [expected PASS] Canvas test: 2d.composite.canvas.destination-atop
@jdm
Copy link
Member

jdm commented Apr 1, 2016

Oh, that wasn't supposed to end up running any tests. Odd. Anyways, you can ignore those (and feel free to interrupt it in the future if it starts running tests when you're not trying to do so).

@mylainos
Copy link
Contributor Author

mylainos commented Apr 1, 2016

There is no error when I do ./mach test-wpt --manifest-update SKIP_TESTS but when I run the wpt tests there is a lot of errors.

@jdm
Copy link
Member

jdm commented Apr 1, 2016

Debug builds in particular are known to have problems with tests in 2dcontext/, so I wouldn't worry about it too much. Running the full testsuite locally usually isn't a great use of your time; it's better to focus on particular tests or directories that are relevant.

@mylainos
Copy link
Contributor Author

mylainos commented Apr 1, 2016

Ok thanks.

@mylainos
Copy link
Contributor Author

mylainos commented Apr 2, 2016

How could I avoid this error The command "bash etc/ci/manifest_changed.sh" exited with 1. ?

@jdm
Copy link
Member

jdm commented Apr 2, 2016

That happens when the build machines run ./mach test-wpt --manifest-update SKIP_TESTS and see the MANIFEST.json file get modified. You should include the changes to that file in this PR.

@jdm jdm removed the S-needs-rebase label Apr 2, 2016
@mylainos
Copy link
Contributor Author

mylainos commented Apr 2, 2016

Done !

@emilio
Copy link
Member

emilio commented Apr 3, 2016

Can you squash the commits? They look good to me! :)

@emilio
Copy link
Member

emilio commented Apr 3, 2016

-S-awaiting-review


Reviewed 4 of 6 files at r1, 1 of 1 files at r2, 1 of 1 files at r4.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


components/script/dom/htmllinkelement.rs, line 93 [r2] (raw file):
It might be a bit more performant this way:

let mut found_stylesheet = false;
for s in value.split(HTML_SPACE_CHARACTERS).iter() {
    match_ignore_ascii_case! { s,
        "stylesheet" => found_stylesheet = true,
        "alternate" => return false, // We don't load alternate stylesheets
         _ => {},
    }
}
found_stylesheet

Though arguably less readable.

In practice, I don't think it matters too much, since I don't think we expect a huge amount of values in a rel attribute, so feel free to either make the change or leave it like it is now.


Comments from Reviewable

@mylainos
Copy link
Contributor Author

mylainos commented Apr 5, 2016

I have this error when I test your code error: macro undefined: 'match_ignore_ascii_case!'

@emilio
Copy link
Member

emilio commented Apr 5, 2016

Yeah, sorry, it's defined in cssparser and we're on script so it's not on scope. The inner part of the loop is equivalent to:

if s.eq_ignore_ascii_case("alternate") {
    return false;
}

if s.eq_ignore_ascii_case("stylesheet") {
    found_stylesheet = true;
}
@mylainos
Copy link
Contributor Author

mylainos commented Apr 5, 2016

.iter() don't work so i used .into_iter().

@emilio
Copy link
Member

emilio commented Apr 5, 2016

Looks great, thanks!

@bors-servo: r+

@bors-servo
Copy link
Contributor

bors-servo commented Apr 5, 2016

📌 Commit 2564352 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Apr 5, 2016

Testing commit 2564352 with merge 0d28d21...

bors-servo added a commit that referenced this pull request Apr 5, 2016
Issue #10284 Ignore alternate stylesheets

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10319)
<!-- Reviewable:end -->
return false;
}

if s.eq_ignore_ascii_case("stylesheet") == true {

This comment has been minimized.

@KiChjang

KiChjang Apr 5, 2016

Member

@bors-servo r-

nit: You can drop the == true here and the one above as well.

This comment has been minimized.

@emilio

emilio Apr 5, 2016

Member

Whoops, missed that, @KiChjang is right

This comment has been minimized.

@mylainos

mylainos Apr 5, 2016

Author Contributor

I forgot to remove it. I had a an error when I was using .iter() which said it didn't know the type.

@emilio
Copy link
Member

emilio commented Apr 5, 2016

Now there it goes!

@bors-servo: r+

@bors-servo
Copy link
Contributor

bors-servo commented Apr 5, 2016

📌 Commit c39c753 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Apr 6, 2016

Testing commit c39c753 with merge 6171188...

bors-servo added a commit that referenced this pull request Apr 6, 2016
Issue #10284 Ignore alternate stylesheets

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10319)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 6, 2016

@bors-servo bors-servo merged commit c39c753 into servo:master Apr 6, 2016
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor was unable to build non-mergeable pull request
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@mylainos mylainos deleted the mylainos:Issue-#10284 branch Apr 6, 2016
@charlesvdv charlesvdv mentioned this pull request Jan 7, 2017
3 of 5 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.