Closed Bug 1572246 Opened 5 months ago Closed 5 months ago

HTML <link> elements in system privilege documents cause history service to load

Categories

(Core :: DOM: Core & HTML, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: bdahl, Assigned: emilio)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file, 1 obsolete file)

Over in bug 1492582, where I'm migrating <window> to <html> the test "browser/base/content/test/performance/browser_startup.js" started failing because of TEST-UNEXPECTED-FAIL | browser/base/content/test/performance/browser_startup.js | resource://gre/modules/PlacesUtils.jsm is not allowed before first paint. PlacesUtils is loaded because of the chain:

  1. changing the "dir" of the root element
  2. descending into children elements and calling Element::UpdateState
  3. IntrinsicState on <link> then calls Link::LinkState
  4. LinkState() causes the places DB to be loaded early

As discussed in bug 1538968, for content priv documents we want to track the visited state of <link> elements. However, for system priv documents we can ignore it.

An HTML link element in a document with a root HTML node causes the
HistoryService to be loaded while loading the document. Once browser.xhtml
starts using a root <html> node the test browser_startup.js will fail
because of this.

We should consider making this change unconditionally, not just for system principal.

I can send a patch later today to rip all the code that handles visitedness from links, since if doing that we should also change stuff to not go through the link update stuff (otherwise we end up here anyway).

Well, earlier tomorrow I assume.

Taking per IRC conversations and such.

Assignee: bdahl → emilio

Intent email: https://groups.google.com/d/msg/mozilla.dev.platform/1NP6oJzK6zg/ftAz_TajAAAJ

For now do the obvious check rather than bigger refactorings, since we keep them
matching :link or not depending on whether they have an href.

I'll file an HTML spec issue about not making them traversable, and a MathML
issue about the craziness that it is that almost all MathML elements can be
links.

Priority: -- → P2
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b3194a6ba51e
Make <link> always unvisited. r=bzbarsky
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Attachment #9083846 - Attachment is obsolete: true

Documentation completed; please take a look at our relevant sprint task for details: https://github.com/mdn/sprints/issues/2102#issuecomment-530762651

Please let me know if the wording looks OK. Thanks!

You need to log in before you can comment on or make changes to this bug.