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

Side by Side Diff: Source/platform/text/BidiResolver.h

Issue 300853007: Empty inline elements always get a line box. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/line/BreakingContextInlineHeaders.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008 Apple Inc. All right reserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008 Apple Inc. All right reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 // When ignoring spaces, this needs to be called for objects that need line boxes such as RenderInlines or 64 // When ignoring spaces, this needs to be called for objects that need line boxes such as RenderInlines or
65 // hard line breaks to ensure that they're not ignored. 65 // hard line breaks to ensure that they're not ignored.
66 void ensureLineBoxInsideIgnoredSpaces(RenderObject* renderer) 66 void ensureLineBoxInsideIgnoredSpaces(RenderObject* renderer)
67 { 67 {
68 Iterator midpoint(0, renderer, 0); 68 Iterator midpoint(0, renderer, 0);
69 stopIgnoringSpaces(midpoint); 69 stopIgnoringSpaces(midpoint);
70 startIgnoringSpaces(midpoint); 70 startIgnoringSpaces(midpoint);
71 } 71 }
72 72
73 void ensureLineBoxForRenderer(RenderObject* renderer)
74 {
75 Iterator midpoint(0, renderer, 0);
76 startIgnoringSpaces(midpoint);
77 stopIgnoringSpaces(midpoint);
78 }
79
73 // Adding a pair of midpoints before a character will split it out into a ne w line box. 80 // Adding a pair of midpoints before a character will split it out into a ne w line box.
74 void ensureCharacterGetsLineBox(Iterator& textParagraphSeparator) 81 void ensureCharacterGetsLineBox(Iterator& textParagraphSeparator)
75 { 82 {
76 Iterator midpoint(0, textParagraphSeparator.object(), textParagraphSepar ator.offset());
rhogan 2014/05/27 21:40:04 This is a redundant line of code I noticed when ad
77 startIgnoringSpaces(Iterator(0, textParagraphSeparator.object(), textPar agraphSeparator.offset() - 1)); 83 startIgnoringSpaces(Iterator(0, textParagraphSeparator.object(), textPar agraphSeparator.offset() - 1));
78 stopIgnoringSpaces(Iterator(0, textParagraphSeparator.object(), textPara graphSeparator.offset())); 84 stopIgnoringSpaces(Iterator(0, textParagraphSeparator.object(), textPara graphSeparator.offset()));
79 } 85 }
80 86
81 void checkMidpoints(Iterator& lBreak) 87 void checkMidpoints(Iterator& lBreak)
82 { 88 {
83 // Check to see if our last midpoint is a start point beyond the line br eak. If so, 89 // Check to see if our last midpoint is a start point beyond the line br eak. If so,
84 // shave it off the list, and shave off a trailing space if the previous end point doesn't 90 // shave it off the list, and shave off a trailing space if the previous end point doesn't
85 // preserve whitespace. 91 // preserve whitespace.
86 if (lBreak.object() && m_numMidpoints && !(m_numMidpoints % 2)) { 92 if (lBreak.object() && m_numMidpoints && !(m_numMidpoints % 2)) {
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 template<class Iterator, class Run> 1085 template<class Iterator, class Run>
1080 MidpointState<Iterator> BidiResolver<Iterator, Run>::midpointStateForIsolatedRun (Run* run) 1086 MidpointState<Iterator> BidiResolver<Iterator, Run>::midpointStateForIsolatedRun (Run* run)
1081 { 1087 {
1082 return m_midpointStateForIsolatedRun.take(run); 1088 return m_midpointStateForIsolatedRun.take(run);
1083 } 1089 }
1084 1090
1085 1091
1086 } // namespace WebCore 1092 } // namespace WebCore
1087 1093
1088 #endif // BidiResolver_h 1094 #endif // BidiResolver_h
OLDNEW
« no previous file with comments | « Source/core/rendering/line/BreakingContextInlineHeaders.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698