resourceloader: Remove creation of dynamic-styles marker
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 26 Apr 2018 00:27:30 +0000 (01:27 +0100)
committerKrinkle <krinklemail@gmail.com>
Thu, 26 Apr 2018 15:53:29 +0000 (15:53 +0000)
commitbffdf972dbab2ea7f9bc19170ae77e2f14fc81dd
tree16505725c926820f4d0aef2cfdda82081c6d1a56
parentb363b8f21bd4aad58ce6e8f7118c3bf3b7f8a1ce
resourceloader: Remove creation of dynamic-styles marker

Firstly, this code is never used because the marker is unconditionally
created by OutputPage. But, we may change that one day, and we
want to reduce dependency on server-side specifics so that the
loader can (in theory) work on any web page. So we want to keep
some kind of fallback for now.

It's a private getter used in two places:

1. addEmbeddedCSS (private): Call newStyleTag with nextNode=marker.
   The newStyleTag function already treats nextNode as optional,
   and falls back to doing the same thing getMarker() was doing,
   which is: append to document.head.

2. addLink (private, debug-mode only): Used the marker as insertion
   point for a new element. Basically the same as newStyleTag,
   except it was using the wrapper of `$().before()` instead
   of calling Node#insertBefore() directly. Made it optional,
   with as fallback appending to document.head. Same as newStyleTag.

Also removed an unused jQuery object in addEmbeddedCSS, from
passing result of newStyleTag() to $(), but not using it.

Bug: T192623
Change-Id: If04c801c073b4cf74bf111d02ce3dc133bb862d1
resources/src/mediawiki/mediawiki.js