Closed
Bug 1406254
Opened 7 years ago
Closed 7 years ago
stylo: incorrect style when ::first-line is used on anchor
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla58
People
(Reporter: bzbarsky, Assigned: jryans)
Details
Attachments
(2 files, 1 obsolete file)
59 bytes,
text/x-review-board-request
|
jryans
:
review+
ritu
:
approval-mozilla-beta+
|
Details |
88 bytes,
text/plain
|
jryans
:
review+
ritu
:
approval-mozilla-beta+
|
Details |
Consider this testcase: <!DOCTYPE html> <style> a { display: block; } a::first-line { color: green; } </style> <a href>Some text</a> In Gecko, Safari, and Chrome the text is green. In Stylo it's the default visited color. jryans, any idea what's going on here? This is specific to text; if I have a <span> inside the <a> it gets the right styles...
Flags: needinfo?(jryans)
Reporter | ||
Updated•7 years ago
|
status-firefox57:
--- → affected
status-firefox58:
--- → affected
tracking-firefox57:
--- → ?
tracking-firefox58:
--- → ?
Updated•7 years ago
|
Priority: -- → P2
Assignee | ||
Comment 1•7 years ago
|
||
I am away at a team meetup this week. I plan to look into this on Monday.
Updated•7 years ago
|
Assignee: nobody → jryans
Assignee | ||
Comment 2•7 years ago
|
||
I can't seem to reproduce the issue here using the latest from autoland today. I tried using the following data URI: data:text/html,<!DOCTYPE html><style>a { display: block; }a::first-line { color: green; }</style><a href>Some text</a> Stylo and Gecko modes appear identical for me, and they match other browsers as well (green text, link underline). :bz, can you still reproduce?
Flags: needinfo?(jryans) → needinfo?(bzbarsky)
Assignee | ||
Comment 3•7 years ago
|
||
Ah, never mind, using a data URI changes the test apparently. Saving the test case in comment 0 to a HTML file loaded via HTTP triggers the problem behavior for me.
Flags: needinfo?(bzbarsky)
Reporter | ||
Comment 4•7 years ago
|
||
Right, you need to have an actual visited link (<a href> is <a href=""> which is pointing to the same page), and we don't save data: URIs in history.
Assignee | ||
Comment 5•7 years ago
|
||
Not sure yet about the root cause here... I have verified that after the cascade on the Servo side, the color value is green for first line (both visited and unvisited). Perhaps Gecko is reading the color value from the wrong style context for first line? Or maybe the default visited color is overriding the author color in this case? I'll keep investigating tomorrow.
Updated•7 years ago
|
status-firefox56:
--- → disabled
status-firefox-esr52:
--- → unaffected
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 8•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=909bb106f94d9d421bd07b647745a41d37731a86
Comment 9•7 years ago
|
||
Comment on attachment 8917568 [details] Bug 1406254 - Clear visited rules for text inheritance. Reviewing this from here because mozreview went down mid-review. Looks good, with the comments below addressed: So, I think it's safe enough to drop the argument and do the visited style builder and such in for_inheritance, dropping the `adjust_for_text` call. This would need a comment saying that we rely on adjust_for_text and such not using visited-dependent properties, or flags that are read from the visited style, but that's the case already (and if it wasn't we'd already be in trouble). Also, the patch would be slightly smaller, which is nice (and easier to uplift), and contain less boilerplate / duplicated code to care about when wanting to inherit styles from other. Last, but not least, can you file a bug on our usage of `parent.flags` in that function and ni? me (or assign me directly)? Some of the flags aren't supposed to be "inherited", like INHERITS_RESET_STYLE / INHERITS_CONTENT. That's fishy, but it's not a problem right now because we only use them for element styles. It should get fixed though.
Attachment #8917568 -
Flags: review?(emilio) → review+
Comment 10•7 years ago
|
||
Comment on attachment 8917569 [details] Bug 1406254 - Visited reftest for ::first-line inheritance. Thanks for fixing this Ryan! 00:59 <jryans> emilio: ok! thanks for the review :) 01:00 <jryans> emilio: (i assume separate test patch also looks good? not sure if you saw it before mozreview died...) 01:00 <emilio> jryans: no worries, nice catch! (I wasn't ccd on that bug, I could've helped out, maybe). I'm sorry I didn't got to the tests before mozreview went down :/ 01:01 <jryans> emilio: it's fine, i learned more about reparenting and such with this one :) 01:01 <emilio> jryans: I can review them in the morning and land them if you want. Since they don't go through Servo code you can put the first patch on the servo queue meanwhile :P 01:02 <emilio> jryans: yeah, that stuff is nasty... :) 01:02 <jryans> emilio: here's the patch for tests https://github.com/jryans/gecko-dev/commit/76a8cc4eebff07563701552fb26a314d8fee7edb 01:04 <emilio> jryans: looks good. Maybe it'd be a good idea to try it with a nested visited link inside the first-line too, but feel free to not write that if you think it'd be too much churn. 01:04 <jryans> ok! 01:06 <emilio> jryans: oh, one question, is there something missing in `color-on-visited-text-1.html`? why does the `<span>` need an ID, did you intend to change its color? 01:07 <jryans> emilio: i just threw in the IDs while debugging, so it would be easier to identify them in some debug logs. can prune from the test, they aren't actually needed there. 01:08 <emilio> jryans: cool, r=me with that, will comment on the bug, thanks!
Attachment #8917569 -
Flags: review?(emilio) → review+
Assignee | ||
Comment 11•7 years ago
|
||
(In reply to Emilio Cobos Álvarez [:emilio] from comment #9) > Comment on attachment 8917568 [details] > Bug 1406254 - Clear visited rules for text inheritance. > > Reviewing this from here because mozreview went down mid-review. > > Looks good, with the comments below addressed: > > So, I think it's safe enough to drop the argument and do the visited style > builder and such in for_inheritance, dropping the `adjust_for_text` call. > > This would need a comment saying that we rely on adjust_for_text and such > not using visited-dependent properties, or flags that are read from the > visited style, but that's the case already (and if it wasn't we'd already be > in trouble). > > Also, the patch would be slightly smaller, which is nice (and easier to > uplift), and contain less boilerplate / duplicated code to care about when > wanting to inherit styles from other. Sure, I'll go with that approach! I wasn't sure if it was better allow the caller of `for_inheritance` to process unvisited and visited similarly. But, you're right, the text adjustments don't actually affect visited properties, so there's no reason to do the extra work. I've changed to this approach and added a comment about it. > Last, but not least, can you file a bug on our usage of `parent.flags` in > that function and ni? me (or assign me directly)? Some of the flags aren't > supposed to be "inherited", like INHERITS_RESET_STYLE / INHERITS_CONTENT. > That's fishy, but it's not a problem right now because we only use them for > element styles. It should get fixed though. Sure, I filed bug 1407832 and ni?ed you.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8917568 -
Flags: review?(emilio) → review+
Assignee | ||
Updated•7 years ago
|
Attachment #8917569 -
Flags: review?(emilio) → review+
Assignee | ||
Comment 14•7 years ago
|
||
https://github.com/servo/servo/pull/18841
Reporter | ||
Comment 15•7 years ago
|
||
jryans, thank you!
Assignee | ||
Comment 16•7 years ago
|
||
Servo-side fix landed: https://hg.mozilla.org/integration/autoland/rev/f26e4a8b210def93bd27914be13f0f777fd79092
Comment 17•7 years ago
|
||
Pushed by jryans@gmail.com: https://hg.mozilla.org/integration/autoland/rev/e921df5cd9b9 Visited reftest for ::first-line inheritance. r=emilio
Comment 18•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e921df5cd9b9
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Assignee | ||
Updated•7 years ago
|
Attachment #8917568 -
Attachment is obsolete: true
Assignee | ||
Comment 19•7 years ago
|
||
Approval Request Comment [Feature/Bug causing the regression]: Stylo regression in ::first-line handling with visited links [User impact if declined]: If declined, some visited links with ::first-line styles won't have the correct styles applied. [Is this code covered by automated tests?]: Yes, this bug adds a test. [Has the fix been verified in Nightly?]: Yes [Needs manual test from QE? If yes, steps to reproduce]: No [List of other uplifts needed for the feature/fix]: Only patches in this bug are needed. [Is the change risky?]: No, I don't believe so. [Why is the change risky/not risky?]: This only affects visited link style handling where selectors such as ::first-line are also used, which I would imagine is fairly rare (but have no data to be sure). The change is also well contained. [String changes made/needed]: None
Attachment #8918024 -
Flags: review+
Attachment #8918024 -
Flags: approval-mozilla-beta?
Assignee | ||
Comment 20•7 years ago
|
||
Comment on attachment 8917569 [details] Bug 1406254 - Visited reftest for ::first-line inheritance. Approval Request Comment See comment 19.
Attachment #8917569 -
Flags: approval-mozilla-beta?
Comment on attachment 8918024 [details] Bug 1406254 - Clear visited rules for text inheritance. Recent regression due to Stylo, Beta57+
Attachment #8918024 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #8917569 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 22•7 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/704d8010a876 https://hg.mozilla.org/releases/mozilla-beta/rev/e71e4cda4c2d
Flags: in-testsuite+
Comment 23•7 years ago
|
||
Backed out from Beta for bustage. Please provide a rebased patch. https://treeherder.mozilla.org/logviewer.html#?job_id=136924877&repo=mozilla-beta https://hg.mozilla.org/releases/mozilla-beta/rev/4a8c7830ff4822da140890800b401d462695ccc5
Flags: needinfo?(jryans)
Assignee | ||
Comment 24•7 years ago
|
||
uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/76b9a79e1fe540b3e7c15047264e79eccf91c150 https://hg.mozilla.org/releases/mozilla-beta/rev/60546645c39020a15adea8341a27f5b525b34e2c
Flags: needinfo?(jryans)
Comment 25•7 years ago
|
||
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #19) > [Is this code covered by automated tests?]: Yes, this bug adds a test. > [Has the fix been verified in Nightly?]: Yes > [Needs manual test from QE? If yes, steps to reproduce]: No Setting qe-verify- based on jryans's assessment on manual testing needs and the fact that this fix has automated coverage.
Flags: qe-verify-
You need to log in
before you can comment on or make changes to this bug.
Description
•