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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/staticrange/staticrange-immutable.html

Issue 2791373002: [InputEvent] Make StaticRange immutable and move tests to wpt (Closed)
Patch Set: Make attributes immutable and address foolip's comments Created 3 years, 8 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
Index: third_party/WebKit/LayoutTests/external/wpt/staticrange/staticrange-immutable.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/staticrange/staticrange-immutable.html b/third_party/WebKit/LayoutTests/external/wpt/staticrange/staticrange-immutable.html
new file mode 100644
index 0000000000000000000000000000000000000000..700d2d8d4f7cfb5714dc3f395f4bd5e45c31ef64
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/staticrange/staticrange-immutable.html
@@ -0,0 +1,28 @@
+<!doctype html>
+<title>StaticRange: Attributes are immutable</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id='txt'>
+abcdefg
+</div>
+<script>
+test(() => {
+ const txt = document.getElementById('txt');
+ const staticRange = new StaticRange();
+ assert_equals(staticRange.startContainer, document);
+ assert_equals(staticRange.startOffset, 0);
+ assert_equals(staticRange.endContainer, document);
+ assert_equals(staticRange.endOffset, 0);
+ assert_true(staticRange.collapsed);
+
+ staticRange.startContainer = txt;
+ assert_equals(staticRange.startContainer, document);
+ staticRange.startOffset = 1;
+ assert_equals(staticRange.startOffset, 0);
+ staticRange.endContainer = txt;
+ assert_equals(staticRange.endContainer, document);
+ staticRange.endOffset = 1;
+ assert_equals(staticRange.endOffset, 0);
+ assert_true(staticRange.collapsed);
+});
qyearsley 2017/04/11 21:18:46 BTW, is it correct that we're not giving this subt
chongz 2017/04/11 22:11:30 I was following the guide here: https://chromium.g
qyearsley 2017/04/11 22:31:50 No, that sounds good, I was just curious :-)
foolip 2017/04/12 04:56:23 FWIW, I like it this way :)
+</script>

Powered by Google App Engine
This is Rietveld 408576698