Closed Bug 1359303 Opened 8 years ago Closed 7 years ago

stylo: should not skip parent display-based style fixups for NAC that is not a NAC root

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: heycam, Assigned: chenpighead)

References

Details

Attachments

(2 files)

From bug 1344914 comment 5, bz points out that Servo is currently skipping parent display-based style fixups for all NAC, whereas we probably only want to do this for NAC roots (and after bug 1358968, anonymous boxes marked as skipping this fixup).
Priority: -- → P2
Priority: P2 → --
Priority: -- → P2
I'll investigate this.
Assignee: nobody → jeremychen
Status: NEW → ASSIGNED
Before I dig deeper into the implementation, I'd like to know if there's a good way to verify if this has already been resolved or not. Hi Boris, any idea about making an automatic/manual test to do the verification? I can't find one in our repo, I guess it is a bit tricky to test the NAC. The worst case might be writing some C++ codes to generate multi-level NACs and print some logs to verify....
Flags: needinfo?(bzbarsky)
This is not fixed, per: #[inline] fn skip_root_and_item_based_display_fixup(&self) -> bool { // We don't want to fix up display values of native anonymous content. // Additionally, we want to skip root-based display fixup for document // level native anonymous content subtree roots, since they're not // really roots from the style fixup perspective. Checking that we // are NAC handles both cases. self.is_native_anonymous() } Changing that line should be enough, I think.
That being said, NAC are under our control, so I'm not sure if we really need to fix this proper. Seems like an easy fix of course, but... :-)
Yeah, looking at this again I think it's probably not worth spending too much time on right now. IIUC we should change the code in comment 3 to check: self.is_native_anonymous() && (self.is_root_of_native_anonymous_subtree() || self.get_implement_pseudo_element().is_some()) So let's just write that patch (get review from bz or heycam), and not worry about testing it.
Flags: needinfo?(bzbarsky)
Priority: P2 → P3
Attachment #8902507 - Flags: review?(cam)
(In reply to Emilio Cobos Álvarez [:emilio] from comment #3) > This is not fixed, per: > > #[inline] > fn skip_root_and_item_based_display_fixup(&self) -> bool { > // We don't want to fix up display values of native anonymous > content. > // Additionally, we want to skip root-based display fixup for > document > // level native anonymous content subtree roots, since they're not > // really roots from the style fixup perspective. Checking that we > // are NAC handles both cases. > self.is_native_anonymous() > } > > Changing that line should be enough, I think. Yes, that's the place I thought I should fix. Just don't know how to test the patch though... (In reply to Bobby Holley (:bholley) (busy with Stylo) from comment #5) > Yeah, looking at this again I think it's probably not worth spending too > much time on right now. > > IIUC we should change the code in comment 3 to check: > > self.is_native_anonymous() && (self.is_root_of_native_anonymous_subtree() || > self.get_implement_pseudo_element().is_some()) > > So let's just write that patch (get review from bz or heycam), and not worry > about testing it. Ok, then I'll just fix it and move on to other bugs. Emilio and Bobby, thanks for the help. :)
I wonder whether this bug would manifest with things in a <foreignObject> used via <use> that need display-based fixup... That's where I'd start trying to write a testcase, at least.
Comment on attachment 8902507 [details] Bug 1359303 - stylo: do not skip parent display-based style fixups for NAC that is not a NAC root. https://reviewboard.mozilla.org/r/174082/#review179392
Attachment #8902507 - Flags: review?(cam) → review+
(In reply to Boris Zbarsky [:bz] (still digging out from vacation mail) from comment #8) > I wonder whether this bug would manifest with things in a <foreignObject> > used via <use> that need display-based fixup... That's where I'd start > trying to write a testcase, at least. Thanks for the pointer. I'll try this today. But if I can't easily make one, maybe we could leave the test as a followup bug.
(In reply to Jeremy Chen [:jeremychen] UTC+8 from comment #10) > Created attachment 8903005 [details] [review] > Servo PR, #18319 https://hg.mozilla.org/integration/autoland/rev/556f8f9a72c4 (In reply to Jeremy Chen [:jeremychen] UTC+8 from comment #11) > Thanks for the pointer. I'll try this today. > But if I can't easily make one, maybe we could leave the test as a followup > bug. I haven't managed to make one at the moment, so I'll resolve this bug once the patch is merged to m-c.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
OK. I just tried a testcase using <use> and it seems to work, so maybe use-cloned nodes are not marked native anonymous or something...
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: