Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/shadow/resources/shadow-dom.js

Issue 1773553003: Removing dependency on js-test.js from shadow-dom.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a clarification comment Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/shadow/tabindex-slot.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/shadow/resources/shadow-dom.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/resources/shadow-dom.js b/third_party/WebKit/LayoutTests/fast/dom/shadow/resources/shadow-dom.js
index 54800d471f4d22ba8fafd586a48a8bbd6c5e3fdf..80a1c00b2a1907f4fd6a1f860aa61a1f67694b26 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/resources/shadow-dom.js
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/resources/shadow-dom.js
@@ -1,3 +1,37 @@
+// TODO(yuzus): These two functions below need cleaning up. They are currently
+// from js-test.js.
+function getOrCreateTestElement(id, tagName)
+{
+ var element = document.getElementById(id);
+ if (element)
+ return element;
+
+ element = document.createElement(tagName);
+ element.id = id;
+ var refNode;
+ var parent = document.body || document.documentElement;
+ if (id == "description")
+ refNode = getOrCreateTestElement("console", "div");
+ else
+ refNode = parent.firstChild;
+
+ parent.insertBefore(element, refNode);
+ return element;
+}
+
+function debug(msg)
+{
+ if (self._lazyTestResults) {
+ self._lazyTestResults.push(msg);
+ } else {
+ var span = document.createElement("span");
+ // insert it first so XHTML knows the namespace;
+ getOrCreateTestElement("console", "div").appendChild(span);
+ span.innerHTML = msg + '<br />';
+ };
+}
+
+
function createShadowRoot()
{
var children = Array.prototype.slice.call(arguments);
@@ -227,6 +261,7 @@ function shouldNavigateFocus(from, to, direction)
debug('PASS');
else
debug('FAIL');
+ return isInnermostActiveElement(to);
}
function navigateFocusForward()
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/shadow/tabindex-slot.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698