Open Bug 1494587 Opened Last year Updated Last year

Dynamically added <link rel="stylesheet alternate"> is not shown in the View > Page Style menu.

Categories

(Firefox :: Menus, defect, P5)

defect

Tracking

()

People

(Reporter: v.takeuchi, Unassigned)

References

()

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0
Build ID: 20180913170256

Steps to reproduce:

Add <link rel="stylesheet alternate"> element to the document:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Sample</title>
</head>
<body>
  <p>Lorem ipsum dolor sit amet.</p>
  <button onclick="addStyleLink()">Add style</button>
  <script>
    function addStyleLink(){
      const link = document.createElement("LINK");
      link.title = "Insane";
      link.rel = "stylesheet alternate";
      link.href = "https://developer.mozilla.org/samples/cssref/altstyles/insane.css";
      document.head.appendChild(link);
    }
  </script>
</body>
</html>



Actual results:

New style is not added to View>Page Style in Menu Bar immediately. After I click "No Style", the new style appears.


Expected results:

The new style appears immediately in the menu.
Component: Untriaged → General
Thanks for filing! Is this a recent regression?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(v.takeuchi)
Component: General → Menus
Summary: Dynamically added <link rel="stylesheet alternate"> is not shown in View>Page Style. → Dynamically added <link rel="stylesheet alternate"> is not shown in the View > Page Style menu.
I could be wrong, but I expect this has been broken at least since this was made to work at all in e10s mode.

There are perf concerns with the current implementation (see bug 1390928). I don't know if there's a reasonable solution here that doesn't make perf worse / harder to deal with, and also addresses this.
Priority: -- → P5
See Also: → 1390928
The solution of just sending a message to the child when the menu is open should address both concerns right?
(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)
> The solution of just sending a message to the child when the menu is open
> should address both concerns right?

Yes, but doesn't work on macOS...
Flags: needinfo?(v.takeuchi)
You need to log in before you can comment on or make changes to this bug.