The default bug view has changed. See this FAQ.

stylo: Need to support all the nsHTMLStyleSheet bits

NEW
Assigned to

Status

()

Core
CSS Parsing and Computation
P1
normal
28 days ago
8 days ago

People

(Reporter: bz, Assigned: manishearth)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(firefox54 affected)

Details

I'm not sure whether we handle all this already and bug 1341712 is the only issue this testcase hits:

  data:text/html,<!DOCTYPE html><table><tr><th>text</th></tr><tr><td>Long text

but chances are we don't handle it.
Boris, can you elaborate a bit more on what needs to be done here?
Flags: needinfo?(bzbarsky)
Priority: -- → P2
Gecko uses nsHTMLStyleSheet to implement various bits, by creating nsIStyleRule instances that are walked by nsHTMLStyleSheet::RulesMatching for certain nodes.  Specifically, these implement:

1) The "link", "alink", and "vlink" attributes on <body>.  These are mapped into style, but not for the body itself.  Instead, during attribute mapping for <body> they're mapped into HTMLColorRules hanging off nsHTMLStyleSheet that are then walked in RulesMatching.  I did just check: these don't work in stylo.  Or servo.  Note that this also needs to trigger restyles on visited/active state transitions for <a> elements, href attribute changes, etc.

2) The default text alignment behavior for <th>, which can't be expressed in parseable CSS.  That is, this is where NS_STYLE_TEXT_ALIGN_MOZ_CENTER_OR_INHERIT specified values of text-align come from.  See TableTHRule::MapRuleInfoInto.  Doesn't work in stylo.

3) Quirks mode tables have interesting color behavior.  See TableQuirkColorRule.  Specifically, if not otherwise specified they get the non-parseable specified value "NS_STYLE_COLOR_INHERIT_FROM_BODY", which then needs to be handled specially when determining computed style.  It does what it says on the tin: inherits the color from the body.  If there is no body, things are a bit complicated.  In practice it starts off as the default color, and after that is changes whenever we compute style for the body, and hence can be stale if the body is removed.  For quirks mode documents the weirdness around the no-body case doesn't obviously matter...  I just checked, and this is broken in both stylo and servo.

4) The "content style rules" of the element.  This is SVG mapped attributes, HTML mapped attributes, HTMLBodyElement::WalkContentStyleRules, HTMLTableCellElement::WalkContentStyleRules, nsXULElement::WalkContentStyleRules.  I think we have these either implemented or with existing bugs covering them.  Again, this includes triggering a restyle when these things change.  Which, by the way, I'm not sure we did right for SVG.  We need to check.  :(

5) Something about the "xml:lang" attribute and how it maps into CSS lang stuff.  I thought we had a bug on this, but I don't see on right now.  Xidorn may know what the state of that is.

6) Some MathML bits, again dealing with lang.
Flags: needinfo?(bzbarsky)
Thanks for the writeup boris. Given that bug 1341647 and bug 1341648 (which are a subset of the issues described above) are already in Manish's bucket, and given that he has experience with the rule mapping stuff, I think it makes sense for him to take it.

Manish, feel free to split this out into sub-bugs or do it all in this bug, whatever's easier.
Assignee: nobody → manishearth
Priority: P2 → P1
You need to log in before you can comment on or make changes to this bug.