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

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

Issue 2621563002: Merge 2924: Fix 'hyphens: auto' to work only when line wrapping is allowed (Closed)
Patch Set: 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 * (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 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 int nextBreakable = -1; 1066 int nextBreakable = -1;
1067 int lastWordBoundary = 0; 1067 int lastWordBoundary = 0;
1068 float cachedWordTrailingSpaceWidth[2] = {0, 0}; // LTR, RTL 1068 float cachedWordTrailingSpaceWidth[2] = {0, 0}; // LTR, RTL
1069 1069
1070 bool breakAll = (styleToUse.wordBreak() == BreakAllWordBreak || 1070 bool breakAll = (styleToUse.wordBreak() == BreakAllWordBreak ||
1071 styleToUse.wordBreak() == BreakWordBreak) && 1071 styleToUse.wordBreak() == BreakWordBreak) &&
1072 styleToUse.autoWrap(); 1072 styleToUse.autoWrap();
1073 bool keepAll = 1073 bool keepAll =
1074 styleToUse.wordBreak() == KeepAllWordBreak && styleToUse.autoWrap(); 1074 styleToUse.wordBreak() == KeepAllWordBreak && styleToUse.autoWrap();
1075 1075
1076 Hyphenation* hyphenation = styleToUse.getHyphenation(); 1076 Hyphenation* hyphenation =
1077 styleToUse.autoWrap() ? styleToUse.getHyphenation() : nullptr;
1077 bool disableSoftHyphen = styleToUse.getHyphens() == HyphensNone; 1078 bool disableSoftHyphen = styleToUse.getHyphens() == HyphensNone;
1078 float maxWordWidth = 0; 1079 float maxWordWidth = 0;
1079 if (!hyphenation) 1080 if (!hyphenation)
1080 maxWordWidth = std::numeric_limits<float>::infinity(); 1081 maxWordWidth = std::numeric_limits<float>::infinity();
1081 1082
1082 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver; 1083 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver;
1083 BidiCharacterRun* run; 1084 BidiCharacterRun* run;
1084 TextDirection textDirection = styleToUse.direction(); 1085 TextDirection textDirection = styleToUse.direction();
1085 if ((is8Bit() && textDirection == LTR) || 1086 if ((is8Bit() && textDirection == LTR) ||
1086 isOverride(styleToUse.unicodeBidi())) { 1087 isOverride(styleToUse.unicodeBidi())) {
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
1973 LayoutRect rect = LayoutRect( 1974 LayoutRect rect = LayoutRect(
1974 IntRect(firstRunX(), firstRunY(), linesBox.width(), linesBox.height())); 1975 IntRect(firstRunX(), firstRunY(), linesBox.width(), linesBox.height()));
1975 LayoutBlock* block = containingBlock(); 1976 LayoutBlock* block = containingBlock();
1976 if (block && hasTextBoxes()) 1977 if (block && hasTextBoxes())
1977 block->adjustChildDebugRect(rect); 1978 block->adjustChildDebugRect(rect);
1978 1979
1979 return rect; 1980 return rect;
1980 } 1981 }
1981 1982
1982 } // namespace blink 1983 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698