HomePhabricator

Avoid using document.write

Authored by Florian on Feb 23 2016, 7:37 PM.

Description

Avoid using document.write

document.write was stubbed in Ic9056d7a779f234a28ddad005fd4d76f2e750fcc and
has a slightly different behaviour now (it now appends the given parameters
to the body directly, instead of adding it to the position where the call
was made). This seems to be a race condition with the usage of document.write
in DismissableSiteNotice to add the site notice with JS for anonymous users and
sometimes results in an undesired outcome.

Instead of having this problem, this change replaces the usage of document.write
with other JavaScript that replaces the content of the siteNotice div, instead of
writing something to the output, only.

This probably fixes T125323.

Bug: T125323
Change-Id: Ideaa18f5fb468261705c115c68c454919ab22c29