| OLD | NEW |
| 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 15 matching lines...) Expand all Loading... |
| 26 #include "platform/text/BidiContext.h" | 26 #include "platform/text/BidiContext.h" |
| 27 #include "platform/text/BidiRunList.h" | 27 #include "platform/text/BidiRunList.h" |
| 28 #include "platform/text/TextDirection.h" | 28 #include "platform/text/TextDirection.h" |
| 29 #include "wtf/HashMap.h" | 29 #include "wtf/HashMap.h" |
| 30 #include "wtf/Noncopyable.h" | 30 #include "wtf/Noncopyable.h" |
| 31 #include "wtf/PassRefPtr.h" | 31 #include "wtf/PassRefPtr.h" |
| 32 #include "wtf/Vector.h" | 32 #include "wtf/Vector.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class RenderObject; | 36 class LayoutObject; |
| 37 | 37 |
| 38 template <class Iterator> class MidpointState { | 38 template <class Iterator> class MidpointState { |
| 39 public: | 39 public: |
| 40 MidpointState() | 40 MidpointState() |
| 41 { | 41 { |
| 42 reset(); | 42 reset(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void reset() | 45 void reset() |
| 46 { | 46 { |
| 47 m_numMidpoints = 0; | 47 m_numMidpoints = 0; |
| 48 m_currentMidpoint = 0; | 48 m_currentMidpoint = 0; |
| 49 m_betweenMidpoints = false; | 49 m_betweenMidpoints = false; |
| 50 } | 50 } |
| 51 | 51 |
| 52 void startIgnoringSpaces(const Iterator& midpoint) | 52 void startIgnoringSpaces(const Iterator& midpoint) |
| 53 { | 53 { |
| 54 ASSERT(!(m_numMidpoints % 2)); | 54 ASSERT(!(m_numMidpoints % 2)); |
| 55 addMidpoint(midpoint); | 55 addMidpoint(midpoint); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void stopIgnoringSpaces(const Iterator& midpoint) | 58 void stopIgnoringSpaces(const Iterator& midpoint) |
| 59 { | 59 { |
| 60 ASSERT(m_numMidpoints % 2); | 60 ASSERT(m_numMidpoints % 2); |
| 61 addMidpoint(midpoint); | 61 addMidpoint(midpoint); |
| 62 } | 62 } |
| 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(LayoutObject* 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 // Adding a pair of midpoints before a character will split it out into a ne
w line box. | 73 // Adding a pair of midpoints before a character will split it out into a ne
w line box. |
| 74 void ensureCharacterGetsLineBox(Iterator& textParagraphSeparator) | 74 void ensureCharacterGetsLineBox(Iterator& textParagraphSeparator) |
| 75 { | 75 { |
| 76 startIgnoringSpaces(Iterator(0, textParagraphSeparator.object(), textPar
agraphSeparator.offset() - 1)); | 76 startIgnoringSpaces(Iterator(0, textParagraphSeparator.object(), textPar
agraphSeparator.offset() - 1)); |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 template<class Iterator, class Run> | 1090 template<class Iterator, class Run> |
| 1091 MidpointState<Iterator> BidiResolver<Iterator, Run>::midpointStateForIsolatedRun
(Run* run) | 1091 MidpointState<Iterator> BidiResolver<Iterator, Run>::midpointStateForIsolatedRun
(Run* run) |
| 1092 { | 1092 { |
| 1093 return m_midpointStateForIsolatedRun.take(run); | 1093 return m_midpointStateForIsolatedRun.take(run); |
| 1094 } | 1094 } |
| 1095 | 1095 |
| 1096 | 1096 |
| 1097 } // namespace blink | 1097 } // namespace blink |
| 1098 | 1098 |
| 1099 #endif // BidiResolver_h | 1099 #endif // BidiResolver_h |
| OLD | NEW |