message: refactoring the meta update scripts
diff: @@ -11,7 +11,6 @@ export class DocsPage {
  @Prop() history: RouterHistory;
  @Prop() path: string;
  @Prop({ context: 'isServer' }) private isServer: boolean;
  - @Prop({ context: 'document' }) private document: HTMLDocument;
  @State() badFetch: Response = null;
  @State() page: Page = { title: null, body: null };
  @@ -56,7 +55,7 @@ export class DocsPage {
  const { location } = this.history;
  const { scrollPosition = [0, 0] } = location;
  const [x, y] = scrollPosition;
  - this.document.documentElement.scrollTo(x, y);
  + document.documentElement.scrollTo(x, y);
  });
  }
  @@ -64,10 +63,10 @@ export class DocsPage {
  setDocumentMeta(page: Page) {
  const { title, meta = {} } = page;
  const metaEls = {
  - title: this.document.getElementsByClassName('meta-title'),
  - description: this.document.getElementsByClassName('meta-description'),
  - url: this.document.getElementsByClassName('meta-url'),
  - image: this.document.getElementsByClassName('meta-image')
  + title: document.head.querySelectorAll('.meta-title'),
  + description: document.head.querySelectorAll('.meta-description'),
  + url: document.head.querySelectorAll('.meta-url'),
  + image: document.head.querySelectorAll('.meta-image')
  };
  function updateMeta(els, update) {
  @@ -87,7 +86,7 @@ export class DocsPage {
  // Favor meta title, else go with auto-title. fallback to generic title
  return meta.title || title ? `${title} - ${suffix}` : suffix;
  };
  - this.document.title = getTitle();
  + document.title = getTitle();
  updateMeta(metaEls.title, getTitle);
  // Canonical URL
  