Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to CreateXULElement for adding a style rule fails #31

Closed
eyalroz opened this issue Sep 2, 2020 · 0 comments
Closed

Attempt to CreateXULElement for adding a style rule fails #31

eyalroz opened this issue Sep 2, 2020 · 0 comments
Assignees
Labels
bug Something isn't working resolved-on-development

Comments

@eyalroz
Copy link
Owner

eyalroz commented Sep 2, 2020

We used to create a style element for adding to a message being composed, like so:

  document.getElementById("content-frame").contentDocument.createXULElement('style');

but this no longer works; possibly, the contentDocument is no longer a XUL document and can't create XUL elements. Instead, it has to be an HTML style element. Also, let's make this code look a bit like the stylesheet link injection function.

@eyalroz eyalroz added the bug Something isn't working label Sep 2, 2020
@eyalroz eyalroz self-assigned this Sep 2, 2020
eyalroz pushed a commit that referenced this issue Sep 2, 2020
Revamped the helper function for adding CSS rules to the document via an ad-hoc stylesheet:

* Renamed `addMessageStyleRules` -> `ensureMessageStyleRulesAdded`
* Now giving a specific ID to the added rules
* No longer adding the style rules if they already exist (protecting against repeat invocations)
* Now using `createElement()` rather than `createXULElement()`.
eyalroz pushed a commit that referenced this issue Sep 2, 2020
Revamped the helper function for adding CSS rules to the document via an ad-hoc stylesheet:

* Renamed `addMessageStyleRules` -> `ensureMessageStyleRulesAdded`
* Now giving a specific ID to the added rules
* No longer adding the style rules if they already exist (protecting against repeat invocations)
* Now using `createElement()` rather than `createXULElement()`.
eyalroz pushed a commit that referenced this issue Sep 5, 2020
Revamped the helper function for adding CSS rules to the document via an ad-hoc stylesheet:

* Renamed `addMessageStyleRules` -> `ensureMessageStyleRulesAdded`
* Now giving a specific ID to the added rules
* No longer adding the style rules if they already exist (protecting against repeat invocations)
* Now using `createElement()` rather than `createXULElement()`.
eyalroz pushed a commit that referenced this issue Sep 5, 2020
Revamped the helper function for adding CSS rules to the document via an ad-hoc stylesheet:

* Renamed `addMessageStyleRules` -> `ensureMessageStyleRulesAdded`
* Now giving a specific ID to the added rules
* No longer adding the style rules if they already exist (protecting against repeat invocations)
* Now using `createElement()` rather than `createXULElement()`.
eyalroz pushed a commit that referenced this issue Sep 5, 2020
Revamped the helper function for adding CSS rules to the document via an ad-hoc stylesheet:

* Renamed `addMessageStyleRules` -> `ensureMessageStyleRulesAdded`
* Now giving a specific ID to the added rules
* No longer adding the style rules if they already exist (protecting against repeat invocations)
* Now using `createElement()` rather than `createXULElement()`.
eyalroz pushed a commit that referenced this issue Sep 5, 2020
Revamped the helper function for adding CSS rules to the document via an ad-hoc stylesheet:

* Renamed `addMessageStyleRules` -> `ensureMessageStyleRulesAdded`
* Now giving a specific ID to the added rules
* No longer adding the style rules if they already exist (protecting against repeat invocations)
* Now using `createElement()` rather than `createXULElement()`.
@eyalroz eyalroz closed this as completed Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved-on-development
Projects
None yet
Development

No branches or pull requests

1 participant