Commit a08fd002 authored by dpapad's avatar dpapad Committed by Commit Bot

sync-confirmation WebUI: Fix action button handling.

Take into account that in Shadow DOM v1 document-fragment elements are reported
in an Event's path.

Bug: 897168
Change-Id: I95d16b46ec2b66244b03f5b9aec98d0ca6dc7abc
Reviewed-on: https://chromium-review.googlesource.com/c/1294422Reviewed-by: default avatarScott Chen <scottchen@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601762}
parent 43e991a4
...@@ -93,9 +93,11 @@ Polymer({ ...@@ -93,9 +93,11 @@ Polymer({
*/ */
getConsentConfirmation_: function(path) { getConsentConfirmation_: function(path) {
for (var element of path) { for (var element of path) {
if (element.hasAttribute('consent-confirmation')) if (element.nodeType !== Node.DOCUMENT_FRAGMENT_NODE &&
element.hasAttribute('consent-confirmation')) {
return element.innerHTML.trim(); return element.innerHTML.trim();
} }
}
assertNotReached('No consent confirmation element found.'); assertNotReached('No consent confirmation element found.');
return ''; return '';
}, },
......
...@@ -14,9 +14,11 @@ cr.define('sync.confirmation', function() { ...@@ -14,9 +14,11 @@ cr.define('sync.confirmation', function() {
function getConsentConfirmation(path) { function getConsentConfirmation(path) {
var consentConfirmation; var consentConfirmation;
for (var element of path) { for (var element of path) {
if (element.hasAttribute('consent-confirmation')) if (element.nodeType !== Node.DOCUMENT_FRAGMENT_NODE &&
element.hasAttribute('consent-confirmation')) {
return element.innerHTML.trim(); return element.innerHTML.trim();
} }
}
assertNotReached('No consent confirmation element found.'); assertNotReached('No consent confirmation element found.');
return ''; return '';
} }
......
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