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

Unified Diff: third_party/WebKit/Source/platform/text/Hyphenation.cpp

Issue 1994483002: Compute min-content width when hyphenation is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: eae review Created 4 years, 7 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/platform/text/Hyphenation.h ('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/platform/text/Hyphenation.cpp
diff --git a/third_party/WebKit/Source/platform/text/Hyphenation.cpp b/third_party/WebKit/Source/platform/text/Hyphenation.cpp
index 563b60f101c31bf096436336029030a7dfc7ab43..b636494c99e008b86f30b02fe60ab432e2195081 100644
--- a/third_party/WebKit/Source/platform/text/Hyphenation.cpp
+++ b/third_party/WebKit/Source/platform/text/Hyphenation.cpp
@@ -34,4 +34,18 @@ void Hyphenation::clearForTesting()
getHyphenationMap().clear();
}
+Vector<size_t, 8> Hyphenation::hyphenLocations(const StringView& text) const
+{
+ Vector<size_t, 8> hyphenLocations;
+ size_t hyphenLocation = text.length();
+ if (hyphenLocation <= minimumSuffixLength)
+ return hyphenLocations;
+ hyphenLocation -= minimumSuffixLength;
+
+ while ((hyphenLocation = lastHyphenLocation(text, hyphenLocation)) >= minimumPrefixLength)
+ hyphenLocations.append(hyphenLocation);
+
+ return hyphenLocations;
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/text/Hyphenation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698