Closed Bug 1293809 Opened 4 years ago Closed 3 years ago

stylo: Don't apply anything other than UA rules to Native Anonymous Content

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: bholley, Assigned: heycam)

References

Details

Attachments

(1 file)

nsStyleSet currently takes care to avoid matching non-UA rules for native anonymous content:

http://searchfox.org/mozilla-central/rev/d83f1528dbcb1e837d99cf5b6c36a90b03bf0e77/layout/style/nsStyleSet.cpp#1110

We need to do this for the Servo backend.


If we use the Servo traversal code to style NAC (like we do now), then Servo needs to be able to detect NAC (presumably via the node flags). If we decide to always style them explicitly, we can presumably use a NAC-aware FFI API.
Blocks: 1292662
Duplicate of this bug: 1319633
Assignee: nobody → cam
Status: NEW → ASSIGNED
Comment on attachment 8813519 [details]
Bug 1293809 - Don't match native anonymous content to user/author rules.

https://reviewboard.mozilla.org/r/94968/#review95184

The rest is straight-forward. r=me

Thanks for doing this cameron :)

::: servo/components/style/stylist.rs:333
(Diff revision 1)
>      pub fn lazily_compute_pseudo_element_style<E>(&self,
>                                                    element: &E,
>                                                    pseudo: &PseudoElement,
>                                                    parent: &Arc<ComputedValues>)
>                                                    -> Option<(Arc<ComputedValues>, StrongRuleNode)>
>          where E: Element<Impl=TheSelectorImpl> +

nit: Since `ElementExt` implies `Element<Impl=TheSelectorImpl>`, you can remove this  bound, here and below.

::: servo/components/style/stylist.rs:512
(Diff revision 1)
> -            }
> +                }
> -        }
> +            }
>  
> -        debug!("style attr important: {:?}", relations);
> +            debug!("style attr important: {:?}", relations);
>  
> -        // Step 7: User and UA `!important` rules.
> +            // Step 7: User and UA `!important` rules.

Can you move/split this comment? We do the User rules conditionally now.
Attachment #8813519 - Flags: review?(ecoal95) → review+
Landed over there.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.