Closed Bug 1345950 Opened 8 years ago Closed 8 years ago

stylo: slow selector flag handling is broken

Categories

(Core :: CSS Parsing and Computation, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: bholley, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

In bug 1338982 comment 9, emilio writes: > The best idea I have right now is using an outparam Vec<(Element, Flags)>, > but that sounds quite terrible :(. I think a better approach might be to pass an FnMut callback through the selector matching machinery, which would allow the code to add the SequentialTask directly, or just immediately set the flags, depending on the callsite. WDYT?
Flags: needinfo?(emilio+bugs)
Blocks: 1338982
(In reply to Bobby Holley (:bholley) (busy with Stylo) from comment #1) > In bug 1338982 comment 9, emilio writes: > > > The best idea I have right now is using an outparam Vec<(Element, Flags)>, > > but that sounds quite terrible :(. > > I think a better approach might be to pass an FnMut callback through the > selector matching machinery, which would allow the code to add the > SequentialTask directly, or just immediately set the flags, depending on the > callsite. > > WDYT? WFM, though it'd be somewhat inconvenient to use from outside of Servo I guess... Not that I have a better idea.
Flags: needinfo?(emilio+bugs)
(In reply to Emilio Cobos Álvarez [:emilio] from comment #2) > (In reply to Bobby Holley (:bholley) (busy with Stylo) from comment #1) > > In bug 1338982 comment 9, emilio writes: > > > > > The best idea I have right now is using an outparam Vec<(Element, Flags)>, > > > but that sounds quite terrible :(. > > > > I think a better approach might be to pass an FnMut callback through the > > selector matching machinery, which would allow the code to add the > > SequentialTask directly, or just immediately set the flags, depending on the > > callsite. > > > > WDYT? > > WFM, though it'd be somewhat inconvenient to use from outside of Servo I > guess... Not that I have a better idea. I don't think so - most of those consumers probably wouldn't set the flags anyway (and can pass |_, _| {}), and consumers that don't need the SequentialTask stuff can just pass |e, f| e.set_flags(f). And maybe even eta-reduce it! ;-)
Putting this on Emilio's plate for now, I can grab it if he doesn't get to it.
Assignee: nobody → emilio+bugs
Sounds good, I'll look at it tomorrow.
I plan to actually implement this once https://github.com/servo/servo/pull/15890 lands, given they're heavily in conflict.
(so I don't forget)
Flags: needinfo?(emilio+bugs)
Blocks: 1348030
Comment on attachment 8849548 [details] Bug 1345950: stylo: Fix slow selector flags. https://reviewboard.mozilla.org/r/122330/#review124670 Stealing from Cameron. lgtm, thanks for doing this.
Attachment #8849548 - Flags: review+
Attachment #8849548 - Flags: review?(cam)
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Flags: needinfo?(emilio+bugs)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: