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

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

Issue 2620873002: Renamed EUnicodeBidi to just UnicodeBidi (Closed)
Patch Set: Rebase Created 3 years, 11 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 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
3 * Copyright (C) 2006 Apple Computer Inc. 3 * Copyright (C) 2006 Apple Computer Inc.
4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 4 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
5 * Copyright (C) 2008 Rob Buis <buis@kde.org> 5 * Copyright (C) 2008 Rob Buis <buis@kde.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 TextDirection textDirection) { 220 TextDirection textDirection) {
221 const ComputedStyle& style = text.styleRef(); 221 const ComputedStyle& style = text.styleRef();
222 222
223 TextRun run( 223 TextRun run(
224 // characters, will be set below if non-zero. 224 // characters, will be set below if non-zero.
225 static_cast<const LChar*>(nullptr), 225 static_cast<const LChar*>(nullptr),
226 0, // length, will be set below if non-zero. 226 0, // length, will be set below if non-zero.
227 0, // xPos, only relevant with allowTabs=true 227 0, // xPos, only relevant with allowTabs=true
228 0, // padding, only relevant for justified text, not relevant for SVG 228 0, // padding, only relevant for justified text, not relevant for SVG
229 TextRun::AllowTrailingExpansion, textDirection, 229 TextRun::AllowTrailingExpansion, textDirection,
230 isOverride(style.unicodeBidi()) /* directionalOverride */); 230 isOverride(style.getUnicodeBidi()) /* directionalOverride */);
231 231
232 if (length) { 232 if (length) {
233 if (text.is8Bit()) 233 if (text.is8Bit())
234 run.setText(text.characters8() + position, length); 234 run.setText(text.characters8() + position, length);
235 else 235 else
236 run.setText(text.characters16() + position, length); 236 run.setText(text.characters16() + position, length);
237 } 237 }
238 238
239 // We handle letter & word spacing ourselves. 239 // We handle letter & word spacing ourselves.
240 run.disableSpacing(); 240 run.disableSpacing();
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 void LayoutSVGInlineText::updateMetricsList(bool& lastCharacterWasWhiteSpace) { 327 void LayoutSVGInlineText::updateMetricsList(bool& lastCharacterWasWhiteSpace) {
328 m_metrics.clear(); 328 m_metrics.clear();
329 329
330 if (!textLength()) 330 if (!textLength())
331 return; 331 return;
332 332
333 TextRun run = 333 TextRun run =
334 constructTextRun(*this, 0, textLength(), styleRef().direction()); 334 constructTextRun(*this, 0, textLength(), styleRef().direction());
335 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver; 335 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver;
336 BidiRunList<BidiCharacterRun>& bidiRuns = bidiResolver.runs(); 336 BidiRunList<BidiCharacterRun>& bidiRuns = bidiResolver.runs();
337 bool bidiOverride = isOverride(styleRef().unicodeBidi()); 337 bool bidiOverride = isOverride(styleRef().getUnicodeBidi());
338 BidiStatus status(TextDirection::kLtr, bidiOverride); 338 BidiStatus status(TextDirection::kLtr, bidiOverride);
339 if (run.is8Bit() || bidiOverride) { 339 if (run.is8Bit() || bidiOverride) {
340 WTF::Unicode::CharDirection direction = WTF::Unicode::LeftToRight; 340 WTF::Unicode::CharDirection direction = WTF::Unicode::LeftToRight;
341 // If BiDi override is in effect, use the specified direction. 341 // If BiDi override is in effect, use the specified direction.
342 if (bidiOverride && !styleRef().isLeftToRightDirection()) 342 if (bidiOverride && !styleRef().isLeftToRightDirection())
343 direction = WTF::Unicode::RightToLeft; 343 direction = WTF::Unicode::RightToLeft;
344 bidiRuns.addRun(new BidiCharacterRun( 344 bidiRuns.addRun(new BidiCharacterRun(
345 status.context->override(), status.context->level(), 0, 345 status.context->override(), status.context->level(), 0,
346 run.charactersLength(), direction, status.context->dir())); 346 run.charactersLength(), direction, status.context->dir()));
347 } else { 347 } else {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } 415 }
416 416
417 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const { 417 PassRefPtr<StringImpl> LayoutSVGInlineText::originalText() const {
418 RefPtr<StringImpl> result = LayoutText::originalText(); 418 RefPtr<StringImpl> result = LayoutText::originalText();
419 if (!result) 419 if (!result)
420 return nullptr; 420 return nullptr;
421 return normalizeWhitespace(result); 421 return normalizeWhitespace(result);
422 } 422 }
423 423
424 } // namespace blink 424 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698