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

Unified Diff: third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp

Issue 2220923002: Make computeInlineBoxPosition() to handle unicode-bidi:isolate correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-08-08T15:03:39 Created 4 years, 4 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 | « third_party/WebKit/Source/core/editing/VisibleUnits.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
index c8b50f62760170f4afbffc591d92ba270da5b850..8264eff379c97aeebc1c9450b4ffaafad0bebd0f 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
@@ -9,7 +9,7 @@
#include "core/editing/VisiblePosition.h"
#include "core/html/HTMLTextFormControlElement.h"
#include "core/layout/LayoutTextFragment.h"
-#include "core/layout/line/InlineBox.h"
+#include "core/layout/line/InlineTextBox.h"
#include <ostream> // NOLINT
namespace blink {
@@ -246,6 +246,18 @@ TEST_F(VisibleUnitsTest, computeInlineBoxPosition)
EXPECT_EQ(computeInlineBoxPosition(PositionInFlatTree(five, 1), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInFlatTree(*five, 1)));
}
+TEST_F(VisibleUnitsTest, computeInlineBoxPositionBidiIsolate)
+{
+ // "|" is bidi-level 0, and "foo" and "bar" are bidi-level 2
+ setBodyContent("|<span id=sample style='unicode-bidi: isolate;'>foo<br>bar</span>|");
+
+ Element* sample = document().getElementById("sample");
+ Node* text = sample->firstChild();
+
+ const InlineBoxPosition& actual = computeInlineBoxPosition(Position(text, 0), TextAffinity::Downstream);
+ EXPECT_EQ(toLayoutText(text->layoutObject())->firstTextBox(), actual.inlineBox);
+}
+
TEST_F(VisibleUnitsTest, endOfDocument)
{
const char* bodyContent = "<a id=host><b id=one>1</b><b id=two>22</b></a>";
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnits.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698