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

Unified Diff: LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-before-style.html

Issue 96483003: CANCEL: Make Document::caretRangeFromPoint() to work with :before style Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-12-03T12:38:54 Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-before-style-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-before-style.html
diff --git a/LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-first-letter-style.html b/LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-before-style.html
similarity index 52%
copy from LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-first-letter-style.html
copy to LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-before-style.html
index 70ed5b2279e0a935e4fb09da65fd886794327275..e0f45b7764b780774f75b80bbdb120c8d63d99f2 100644
--- a/LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-first-letter-style.html
+++ b/LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-before-style.html
@@ -1,24 +1,27 @@
+<!DOCTYPE html>
<style>
-p.first-letter:first-letter { color: red; }
+p.before:before { content: "BEFORE"; color: red; }
</style>
<div id="container">
<p id="description"></p>
-<p id="sample" class="first-letter"><span>0123456</span></p>
+<p id="sample" class="before"><span>0123456</span></p>
</div>
-<div id="console"></div>
+<div id="xconsole"></div>
ojan 2013/12/03 23:48:22 Why leave this element in the page at all?
<script src="../../../../resources/js-test.js"></script>
<script>
-description('caretRangeFromPoint() should work with :first-letter style');
+description('caretRangeFromPoint() should work with :before style');
function $(id) { return document.getElementById(id); }
-var middle = $('sample').offsetTop + $('sample').offsetHeight / 2;
var left = $('sample').offsetLeft;
-var numberOfChars = $('sample').firstChild.firstChild.length;
+var numberOfChars = "BEFORE".length;
var charWidth = $('sample').firstChild.offsetWidth / numberOfChars;
var x = left;
+if (document.caretPositionFromPoint)
+ document.caretRangeFromPoint = document.caretPositionFromPoint;
for (var i = 0; i < numberOfChars; ++i) {
+ var middle = $('sample').offsetTop + $('sample').offsetHeight / 2;
var range = document.caretRangeFromPoint(x + 3, middle);
- shouldBe('range.startOffset', i.toString());
+ shouldBeNull(i + '; range');
x += charWidth;
}
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-before-style-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698