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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/ranges/Range-commonAncestorContainer.html

Issue 1529523002: Import dom/ from web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak W3CImportExpectations Created 5 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <title>Range.commonAncestorContainer tests</title>
3 <link rel="author" title="Aryeh Gregor" href=ayg@aryeh.name>
4 <meta name=timeout content=long>
5 <div id=log></div>
6 <script src=../../../../resources/testharness.js></script>
7 <script src=../../../../resources/testharnessreport.js></script>
8 <script src=../common.js></script>
9 <script>
10 "use strict";
11
12 testRanges.unshift("[detached]");
13
14 for (var i = 0; i < testRanges.length; i++) {
15 test(function() {
16 var range;
17 if (i == 0) {
18 range = document.createRange();
19 range.detach();
20 } else {
21 range = rangeFromEndpoints(eval(testRanges[i]));
22 }
23
24 // "Let container be start node."
25 var container = range.startContainer;
26
27 // "While container is not an inclusive ancestor of end node, let
28 // container be container's parent."
29 while (container != range.endContainer
30 && !isAncestor(container, range.endContainer)) {
31 container = container.parentNode;
32 }
33
34 // "Return container."
35 assert_equals(range.commonAncestorContainer, container);
36 }, i + ": range " + testRanges[i]);
37 }
38
39 testDiv.style.display = "none";
40 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698