| 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, 2009, 2010, 2011 Apple Inc. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 4 * All right reserved. | 4 * All right reserved. |
| 5 * Copyright (C) 2010 Google Inc. All rights reserved. | 5 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 TextDirection determinePlaintextDirectionality(LineLayoutItem root, | 80 TextDirection determinePlaintextDirectionality(LineLayoutItem root, |
| 81 LineLayoutItem current, | 81 LineLayoutItem current, |
| 82 unsigned pos) { | 82 unsigned pos) { |
| 83 LineLayoutItem firstLayoutObject = | 83 LineLayoutItem firstLayoutObject = |
| 84 firstLayoutObjectForDirectionalityDetermination(root, current); | 84 firstLayoutObjectForDirectionalityDetermination(root, current); |
| 85 InlineIterator iter(LineLayoutItem(root), firstLayoutObject, | 85 InlineIterator iter(LineLayoutItem(root), firstLayoutObject, |
| 86 firstLayoutObject == current ? pos : 0); | 86 firstLayoutObject == current ? pos : 0); |
| 87 InlineBidiResolver observer; | 87 InlineBidiResolver observer; |
| 88 observer.setStatus(BidiStatus(root.style()->direction(), | 88 observer.setStatus(BidiStatus(root.style()->direction(), |
| 89 isOverride(root.style()->unicodeBidi()))); | 89 isOverride(root.style()->getUnicodeBidi()))); |
| 90 observer.setPositionIgnoringNestedIsolates(iter); | 90 observer.setPositionIgnoringNestedIsolates(iter); |
| 91 return observer.determineParagraphDirectionality(); | 91 return observer.determineParagraphDirectionality(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 static inline void setupResolverToResumeInIsolate(InlineBidiResolver& resolver, | 94 static inline void setupResolverToResumeInIsolate(InlineBidiResolver& resolver, |
| 95 LineLayoutItem root, | 95 LineLayoutItem root, |
| 96 LineLayoutItem startObject) { | 96 LineLayoutItem startObject) { |
| 97 if (root != startObject) { | 97 if (root != startObject) { |
| 98 LineLayoutItem parent = startObject.parent(); | 98 LineLayoutItem parent = startObject.parent(); |
| 99 setupResolverToResumeInIsolate(resolver, root, parent); | 99 setupResolverToResumeInIsolate(resolver, root, parent); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // nothing about LayoutObject). | 133 // nothing about LayoutObject). |
| 134 LineLayoutItem isolatedInline = | 134 LineLayoutItem isolatedInline = |
| 135 highestContainingIsolateWithinRoot(startObj, currentRoot); | 135 highestContainingIsolateWithinRoot(startObj, currentRoot); |
| 136 ASSERT(isolatedInline); | 136 ASSERT(isolatedInline); |
| 137 | 137 |
| 138 InlineBidiResolver isolatedResolver; | 138 InlineBidiResolver isolatedResolver; |
| 139 LineMidpointState& isolatedLineMidpointState = | 139 LineMidpointState& isolatedLineMidpointState = |
| 140 isolatedResolver.midpointState(); | 140 isolatedResolver.midpointState(); |
| 141 isolatedLineMidpointState = | 141 isolatedLineMidpointState = |
| 142 topResolver.midpointStateForIsolatedRun(isolatedRun.runToReplace); | 142 topResolver.midpointStateForIsolatedRun(isolatedRun.runToReplace); |
| 143 EUnicodeBidi unicodeBidi = isolatedInline.style()->unicodeBidi(); | 143 UnicodeBidi unicodeBidi = isolatedInline.style()->getUnicodeBidi(); |
| 144 TextDirection direction; | 144 TextDirection direction; |
| 145 if (unicodeBidi == EUnicodeBidi::kPlaintext) { | 145 if (unicodeBidi == UnicodeBidi::kPlaintext) { |
| 146 direction = determinePlaintextDirectionality( | 146 direction = determinePlaintextDirectionality( |
| 147 isolatedInline, isNewUBAParagraph ? startObj : 0); | 147 isolatedInline, isNewUBAParagraph ? startObj : 0); |
| 148 } else { | 148 } else { |
| 149 DCHECK(unicodeBidi == EUnicodeBidi::kIsolate || | 149 DCHECK(unicodeBidi == UnicodeBidi::kIsolate || |
| 150 unicodeBidi == EUnicodeBidi::kIsolateOverride); | 150 unicodeBidi == UnicodeBidi::kIsolateOverride); |
| 151 direction = isolatedInline.style()->direction(); | 151 direction = isolatedInline.style()->direction(); |
| 152 } | 152 } |
| 153 isolatedResolver.setStatus(BidiStatus::createForIsolate( | 153 isolatedResolver.setStatus(BidiStatus::createForIsolate( |
| 154 direction, isOverride(unicodeBidi), isolatedRun.level)); | 154 direction, isOverride(unicodeBidi), isolatedRun.level)); |
| 155 | 155 |
| 156 setupResolverToResumeInIsolate(isolatedResolver, isolatedInline, startObj); | 156 setupResolverToResumeInIsolate(isolatedResolver, isolatedInline, startObj); |
| 157 | 157 |
| 158 // The starting position is the beginning of the first run within the | 158 // The starting position is the beginning of the first run within the |
| 159 // isolate that was identified during the earlier call to | 159 // isolate that was identified during the earlier call to |
| 160 // createBidiRunsForLine. This can be but is not necessarily the first | 160 // createBidiRunsForLine. This can be but is not necessarily the first |
| (...skipping 23 matching lines...) Expand all Loading... |
| 184 topResolver.setMidpointStateForIsolatedRun( | 184 topResolver.setMidpointStateForIsolatedRun( |
| 185 runWithContext.runToReplace, | 185 runWithContext.runToReplace, |
| 186 isolatedResolver.midpointStateForIsolatedRun( | 186 isolatedResolver.midpointStateForIsolatedRun( |
| 187 runWithContext.runToReplace)); | 187 runWithContext.runToReplace)); |
| 188 topResolver.isolatedRuns().push_back(runWithContext); | 188 topResolver.isolatedRuns().push_back(runWithContext); |
| 189 } | 189 } |
| 190 } | 190 } |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace blink | 193 } // namespace blink |
| OLD | NEW |