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

Unified Diff: Source/core/dom/FirstLetterPseudoElement.cpp

Issue 1277803004: Revert of Elements whose contents start with an astral Unicode symbol disappear when CSS `::first-letter` is … (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
Index: Source/core/dom/FirstLetterPseudoElement.cpp
diff --git a/Source/core/dom/FirstLetterPseudoElement.cpp b/Source/core/dom/FirstLetterPseudoElement.cpp
index 598744bf219f55201e77979e356c7c2d9126aae5..08d3a1c00b881de7a045f75bbd5140ccb52c246d 100644
--- a/Source/core/dom/FirstLetterPseudoElement.cpp
+++ b/Source/core/dom/FirstLetterPseudoElement.cpp
@@ -30,7 +30,6 @@
#include "core/layout/LayoutObjectInlines.h"
#include "core/layout/LayoutText.h"
#include "core/layout/LayoutTextFragment.h"
-#include "platform/text/TextBreakIterator.h"
#include "wtf/TemporaryChange.h"
#include "wtf/text/WTFString.h"
#include "wtf/text/icu/UnicodeIcu.h"
@@ -78,10 +77,7 @@
return 0;
// Account the next character for first letter.
- const String substring = text.substring(length);
- const unsigned substringLength = substring.length();
- const UChar* normalizedBuffer = substring.is8Bit() ? String::make16BitFrom8BitSource(substring.characters8(), substringLength).characters16() : substring.characters16();
- length += countCharactersAndGraphemesInCluster(normalizedBuffer, substringLength, 0, 1).characters;
+ length++;
// Keep looking for allowed punctuation for the :first-letter.
for (; length < textLength; ++length) {
« no previous file with comments | « LayoutTests/css1/pseudo/firstletter-surrogate-expected.html ('k') | Source/platform/fonts/shaping/HarfBuzzShaper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698