Chromium Code Reviews

Unified Diff: Source/core/layout/api/LineLayoutText.cpp

Issue 1164933006: Create LineLayout api (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: Source/core/layout/api/LineLayoutText.cpp
diff --git a/Source/core/layout/api/LineLayoutText.cpp b/Source/core/layout/api/LineLayoutText.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1d126a71d760633af8ff06c82f0f4cecff681f8b
--- /dev/null
+++ b/Source/core/layout/api/LineLayoutText.cpp
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/layout/api/LineLayoutText.h"
+
+namespace blink {
+
+LineLayoutText::LineLayoutText(const LineLayoutItem& item)
+ : LineLayoutItem(item)
+{
+ ASSERT(!item.layoutObject() || item.layoutObject()->isText());
+}
+
+bool LineLayoutText::isWordBreak() const
+{
+ return text()->isWordBreak();
+}
+
+bool LineLayoutText::isAllCollapsibleWhitespace() const
+{
+ return text()->isAllCollapsibleWhitespace();
+}
+
+UChar LineLayoutText::characterAt(unsigned offset) const
+{
+ return text()->characterAt(offset);
+}
+
+unsigned LineLayoutText::textLength() const
+{
+ return text()->textLength();
+}
+
+} // namespace blink

Powered by Google App Engine