Note: There are a few cases of duplicates in user autocompletion which are being worked on.

stylo: URL is incorrectly resolved when it is from a stylesheet loaded via @import

RESOLVED FIXED in Firefox 56

Status

()

Core
CSS Parsing and Computation
P1
normal
RESOLVED FIXED
6 months ago
a month ago

People

(Reporter: xidorn, Assigned: xidorn)

Tracking

(Blocks: 2 bugs)

Trunk
mozilla56
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox53 affected, firefox56 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 months ago
Having the following code in "/test.html":
<!DOCTYPE html>
<style>
@import url(res/test.css);
</style>
<div id="test></div>

and the following code in "/res/test.css":
#test { background-image: url(a.png); }

The background-image of #test is resolved to "/a.png" rather than the expected result "/res/a.png".

(This is a failure revealed by layout/style/test/test_bug397427.html, although that test is meant to check effect of stylesheet redirection.)
This looks baseURI-related. Xidorn is looking at similar stuff in bug 1343964.
Assignee: nobody → xidorn+moz
Priority: -- → P1
Blocks: 1243581
(Assignee)

Comment 2

2 months ago
I really hope I had left some note to myself... I think I had idea about how this should be fixed before...
(Assignee)

Comment 3

2 months ago
Tried to think a bit, I think the idea was that, we need to change Stylesheet::update_from_str. We need to make that method take a UrlExtraData (at url_data) rather than having a reference, and assign url_data to Stylesheet.url_data. We may need to wrap RwLock around url_data for this.
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 6

a month ago
mozreview-review
Comment on attachment 8875570 [details]
Bug 1331291 part 1 - Set stylesheet url_data correctly for import rule.

https://reviewboard.mozilla.org/r/146988/#review152226
Attachment #8875570 - Flags: review?(cam) → review+

Comment 7

a month ago
mozreview-review
Comment on attachment 8875571 [details]
Bug 1331291 part 2 - Add test for inserting rule into imported stylesheet.

https://reviewboard.mozilla.org/r/146990/#review152228
Attachment #8875571 - Flags: review?(cam) → review+
(Assignee)

Comment 8

a month ago
Servo side: servo/servo#17286
Comment hidden (mozreview-request)
(Assignee)

Updated

a month ago
Attachment #8875570 - Attachment is obsolete: true

Comment 10

a month ago
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1aac46ac7a39
part 2 - Add test for inserting rule into imported stylesheet. r=heycam

Comment 11

a month ago
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/678273a09bc0
followup - Disable the new test added.
(Assignee)

Comment 12

a month ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=578fff6259b9bb7029535293897d1ea05a6ba9c0

Comment 13

a month ago
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/62c2763b9dd6
followup 2 - Fix the test added in the bug and enable it.

Comment 14

a month ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/1aac46ac7a39
https://hg.mozilla.org/mozilla-central/rev/678273a09bc0
https://hg.mozilla.org/mozilla-central/rev/62c2763b9dd6
Status: NEW → RESOLVED
Last Resolved: a month ago
status-firefox56: --- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.