Closed Bug 1572246 Opened 5 months ago Closed 5 months ago

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


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




Tracking Status
firefox70 --- fixed


(Reporter: bdahl, Assigned: emilio)



(Keywords: dev-doc-complete)


(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:

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

Priority: -- → P2
Pushed by
Make <link> always unvisited. r=bzbarsky
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:

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.