Closed Bug 1367312 Opened 7 years ago Closed 7 years ago

stylo: Implement :-moz-lwtheme* pseudo-classes

Categories

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

53 Branch
enhancement

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: xidorn, Assigned: mbrubeck)

References

Details

Attachments

(1 file)

This hasn't been implemented.

These pseudo-classes only make sense in XUL document, so we probably don't need to implement in MVP if it is nontrivial to implement.

Alternatively, we can simply unship it from content (making it internal in Gecko). I don't expect unshipping this to be painful... but who knows :)
If we unship this, it would no longer testable in plain mochitest, then we would not need to worry about it.

I guess we may eventually want to support it for chrome, so if it is not too hard to implement, we should just implement it.
Priority: -- → P2
Assignee: nobody → mbrubeck
Status: NEW → ASSIGNED
Comment on attachment 8881572 [details]
Bug 1367312 - stylo: Implement :-moz-lwtheme* pseudo-classes.

https://reviewboard.mozilla.org/r/152738/#review157904

::: dom/xul/XULDocument.cpp:4570
(Diff revision 1)
> +
> +nsIDocument::DocumentTheme
> +XULDocument::ThreadSafeGetDocumentLWTheme() const
> +{
> +    DocumentTheme theme = mDocLWTheme;
> +    if (theme == Doc_Theme_Uninitialized) {

nit: This may be a bit cleaner with:

```
if (mDocLWTheme != Doc_Theme_Uninitialized) {

  return mDocLWTheme;
}

// The rest of the function.
```

::: layout/style/ServoBindings.cpp:822
(Diff revision 1)
>  
>    nsCOMPtr<nsIAtom> atom = attr->GetAtomValue();
>    return atom.forget().take();
>  }
>  
> +int

I'm assuming there's a good reason for this, but why not nsIDocument::DocumentTheme? You should be able to whitelist it in `ServoBindings.toml`.

::: layout/style/ServoBindings.cpp:823
(Diff revision 1)
>    nsCOMPtr<nsIAtom> atom = attr->GetAtomValue();
>    return atom.forget().take();
>  }
>  
> +int
> +Gecko_GetDocumentLWTheme(const nsIDocument *aDocument) {

nit: brace to the next line, start near the type.
Attachment #8881572 - Flags: review?(emilio+bugs) → review+
Pushed by mbrubeck@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fdbe7c1be3a5
stylo: Implement :-moz-lwtheme* pseudo-classes. r=emilio
https://hg.mozilla.org/mozilla-central/rev/fdbe7c1be3a5
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.