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

Side by Side Diff: Source/core/rendering/InlineTextBox.cpp

Issue 255323004: Rendering text-justify:distribute for 8 bit characters. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 3rd (WIP) Created 6 years, 3 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, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 charactersWithHyphen->append(hyphenString); 1441 charactersWithHyphen->append(hyphenString);
1442 string = charactersWithHyphen->toString().createView(); 1442 string = charactersWithHyphen->toString().createView();
1443 maximumLength = string.length(); 1443 maximumLength = string.length();
1444 } 1444 }
1445 1445
1446 ASSERT(maximumLength >= static_cast<int>(string.length())); 1446 ASSERT(maximumLength >= static_cast<int>(string.length()));
1447 1447
1448 TextRun run(string, textPos(), expansion(), expansionBehavior(), direction() , dirOverride() || style->rtlOrdering() == VisualOrder, !renderer().canUseSimple FontCodePath()); 1448 TextRun run(string, textPos(), expansion(), expansionBehavior(), direction() , dirOverride() || style->rtlOrdering() == VisualOrder, !renderer().canUseSimple FontCodePath());
1449 run.setTabSize(!style->collapseWhiteSpace(), style->tabSize()); 1449 run.setTabSize(!style->collapseWhiteSpace(), style->tabSize());
1450 run.setCharacterScanForCodePath(!renderer().canUseSimpleFontCodePath()); 1450 run.setCharacterScanForCodePath(!renderer().canUseSimpleFontCodePath());
1451 run.setTextJustifyStore(static_cast<TextJustifyStore>(style->textJustify())) ;
1451 if (textRunNeedsRenderingContext(font)) 1452 if (textRunNeedsRenderingContext(font))
1452 run.setRenderingContext(SVGTextRunRenderingContext::create(&renderer())) ; 1453 run.setRenderingContext(SVGTextRunRenderingContext::create(&renderer())) ;
1453 1454
1454 // Propagate the maximum length of the characters buffer to the TextRun, eve n when we're only processing a substring. 1455 // Propagate the maximum length of the characters buffer to the TextRun, eve n when we're only processing a substring.
1455 run.setCharactersLength(maximumLength); 1456 run.setCharactersLength(maximumLength);
1456 ASSERT(run.charactersLength() >= run.length()); 1457 ASSERT(run.charactersLength() >= run.length());
1457 return run; 1458 return run;
1458 } 1459 }
1459 1460
1460 TextRun InlineTextBox::constructTextRunForInspector(RenderStyle* style, const Fo nt& font) const 1461 TextRun InlineTextBox::constructTextRunForInspector(RenderStyle* style, const Fo nt& font) const
(...skipping 21 matching lines...) Expand all
1482 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); 1483 printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj);
1483 const int rendererCharacterOffset = 24; 1484 const int rendererCharacterOffset = 24;
1484 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) 1485 for (; printedCharacters < rendererCharacterOffset; printedCharacters++)
1485 fputc(' ', stderr); 1486 fputc(' ', stderr);
1486 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata()); 1487 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata());
1487 } 1488 }
1488 1489
1489 #endif 1490 #endif
1490 1491
1491 } // namespace blink 1492 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698