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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutText.cpp

Issue 2025503002: Revert of Expand WTF::StringView's API to be more like StringPiece. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 static float maxWordFragmentWidth(LayoutText* layoutText, 866 static float maxWordFragmentWidth(LayoutText* layoutText,
867 const ComputedStyle& style, const Font& font, TextDirection textDirection, 867 const ComputedStyle& style, const Font& font, TextDirection textDirection,
868 Hyphenation& hyphenation, unsigned wordOffset, unsigned wordLength, 868 Hyphenation& hyphenation, unsigned wordOffset, unsigned wordLength,
869 int& suffixStart) 869 int& suffixStart)
870 { 870 {
871 suffixStart = 0; 871 suffixStart = 0;
872 if (wordLength <= Hyphenation::minimumSuffixLength) 872 if (wordLength <= Hyphenation::minimumSuffixLength)
873 return 0; 873 return 0;
874 874
875 Vector<size_t, 8> hyphenLocations = hyphenation.hyphenLocations( 875 Vector<size_t, 8> hyphenLocations = hyphenation.hyphenLocations(
876 StringView(layoutText->text(), wordOffset, wordLength)); 876 layoutText->text().createView(wordOffset, wordLength));
877 if (hyphenLocations.isEmpty()) 877 if (hyphenLocations.isEmpty())
878 return 0; 878 return 0;
879 879
880 float minimumFragmentWidthToConsider = Hyphenation::minimumPrefixWidth(font) ; 880 float minimumFragmentWidthToConsider = Hyphenation::minimumPrefixWidth(font) ;
881 float maxFragmentWidth = 0; 881 float maxFragmentWidth = 0;
882 TextRun run = constructTextRun(font, layoutText, wordOffset, wordLength, sty le, textDirection); 882 TextRun run = constructTextRun(font, layoutText, wordOffset, wordLength, sty le, textDirection);
883 size_t end = wordLength; 883 size_t end = wordLength;
884 for (size_t start : hyphenLocations) { 884 for (size_t start : hyphenLocations) {
885 float fragmentWidth = font.getCharacterRange(run, start, end).width(); 885 float fragmentWidth = font.getCharacterRange(run, start, end).width();
886 886
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
1755 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { 1755 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
1756 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason); 1756 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason);
1757 if (box->truncation() != cNoTruncation) { 1757 if (box->truncation() != cNoTruncation) {
1758 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) 1758 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox())
1759 paintInvalidationContainer.invalidateDisplayItemClientOnBacking( *ellipsisBox, invalidationReason); 1759 paintInvalidationContainer.invalidateDisplayItemClientOnBacking( *ellipsisBox, invalidationReason);
1760 } 1760 }
1761 } 1761 }
1762 } 1762 }
1763 1763
1764 } // namespace blink 1764 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698