Commit 9c0d0afb authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Replace usages of old createElement string second argument API

This usage breaks when Custom Elements v0 is turned off, so this
CL updates to a ElementCreationOptions object.

Existing tests, plus the work [1] to remove custom elements v0
for WebUI, should catch issues with this change.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2512381

Bug: 1110954
Change-Id: Ia44ce07366edd34d916d78c93ab5c0b786ba223b
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2519385
Commit-Queue: dpapad <dpapad@chromium.org>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Auto-Submit: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824545}
parent a6156dea
......@@ -149,14 +149,16 @@ cr.define('device_table', function() {
// Make two extra cells for the inspect link and connect errors.
const inspectCell = row.insertCell();
const inspectLink = document.createElement('a', 'action-link');
const inspectLink = document.createElement('a', {is: 'action-link'});
inspectLink.setAttribute('is', 'action-link');
inspectLink.textContent = 'Inspect';
inspectCell.appendChild(inspectLink);
inspectLink.addEventListener('click', function() {
this.handleInspectClick_(row.sectionRowIndex);
}.bind(this));
const forgetLink = document.createElement('a', 'action-link');
const forgetLink = document.createElement('a', {is: 'action-link'});
forgetLink.setAttribute('is', 'action-link');
forgetLink.textContent = 'Forget';
inspectCell.appendChild(forgetLink);
forgetLink.addEventListener('click', function() {
......
......@@ -52,7 +52,8 @@ cr.define('snackbar', function() {
this.classList.add('snackbar');
this.messageDiv_ = document.createElement('div');
this.appendChild(this.messageDiv_);
this.actionLink_ = document.createElement('a', 'action-link');
this.actionLink_ = document.createElement('a', {is: 'action-link'});
this.actionLink_.setAttribute('is', 'action-link');
this.appendChild(this.actionLink_);
this.boundStartTimeout_ = this.startTimeout_.bind(this);
......
......@@ -13,9 +13,9 @@
// underlined). This gives the user an idea that clicking this link will do
// something similar to navigation but in the same page.
//
// They can be created in JavaScript like this:
// They can be created in JavaScript like this (note second arg):
//
// var link = document.createElement('a', 'action-link'); // Note second arg.
// var link = document.createElement('a', {is: 'action-link'});
//
// or with a constructor like this:
//
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment