Changeset 84436 in webkit
- Timestamp:
- Apr 20, 2011 4:48:23 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r84433 r84436 1 2011-04-20 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Ryosuke Niwa. 4 5 Split bidiFirst into two functions 6 https://bugs.webkit.org/show_bug.cgi?id=59025 7 8 I don't have a full understanding of the skipInlines case yet 9 (hence it's not as pretty as the non-skipping case), but 10 this is clearly a win, as both functions are much simpler 11 than their combined version. 12 13 Both of these functions still have bad names. However the 14 bidiNext/bidiFirst names date all the way back to revision 1 15 of the WebKit repository. :) So I don't feel too bad keeping 16 them for the moment. 17 18 * rendering/InlineIterator.h: 19 (WebCore::bidiNext): 20 (WebCore::bidiFirstSkippingInlines): 21 (WebCore::bidiFirstNotSkippingInlines): 22 * rendering/RenderBlock.cpp: 23 (WebCore::RenderBlock::simplifiedNormalFlowLayout): 24 * rendering/RenderBlockLineLayout.cpp: 25 (WebCore::RenderBlock::layoutInlineChildren): 26 (WebCore::RenderBlock::determineStartPosition): 27 1 28 2011-04-20 Jia Pu <jpu@apple.com> 2 29 -
trunk/Source/WebCore/rendering/InlineIterator.h
r83240 r84436 138 138 { 139 139 RenderObject* next = 0; 140 // oldEndOfInline denotes if when we last stopped iterating if we were at the end of an inline. 140 141 bool oldEndOfInline = endOfInlinePtr ? *endOfInlinePtr : false; 141 142 bool endOfInline = false; … … 148 149 } 149 150 151 // We hit this when either current has no children, or when current is not a renderer we care about. 150 152 if (!next) { 153 // If it is a renderer we care about, and we're doing our inline-walk, return it. 151 154 if (!skipInlines && !oldEndOfInline && current->isRenderInline()) { 152 155 next = current; … … 189 192 } 190 193 191 static inline RenderObject* bidiFirst(RenderObject* root, InlineBidiResolver* resolver, bool skipInlines = true) 192 { 193 if (!root->firstChild()) 194 static inline RenderObject* bidiFirstSkippingInlines(RenderObject* root, InlineBidiResolver* resolver) 195 { 196 ASSERT(resolver); 197 RenderObject* o = root->firstChild(); 198 if (!o) 194 199 return 0; 195 200 196 RenderObject* o = root->firstChild();197 201 if (o->isRenderInline()) { 198 202 notifyResolverEnteredObject(resolver, o); 199 if ( skipInlines &&o->firstChild())200 o = bidiNext(root, o, resolver, skipInlines);203 if (o->firstChild()) 204 o = bidiNext(root, o, resolver, true); 201 205 else { 202 206 // Never skip empty inlines. … … 207 211 } 208 212 213 // FIXME: Unify this with the bidiNext call above. 209 214 if (o && !o->isText() && !o->isReplaced() && !o->isFloating() && !o->isPositioned()) 210 o = bidiNext(root, o, resolver, skipInlines); 211 212 if (resolver) 213 resolver->commitExplicitEmbedding(); 215 o = bidiNext(root, o, resolver, true); 216 217 resolver->commitExplicitEmbedding(); 214 218 return o; 219 } 220 221 // FIXME: This method needs to be renamed when bidiNext finds a good name. 222 static inline RenderObject* bidiFirstNotSkippingInlines(RenderObject* root) 223 { 224 RenderObject* o = root->firstChild(); 225 // If either there are no children to walk, or the first one is correct 226 // then just return it. 227 if (!o || o->isRenderInline() || o->isText() || o->isReplaced() || o->isFloating() || o->isPositioned()) 228 return o; 229 230 return bidiNext(root, o, 0, false); 215 231 } 216 232 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r84096 r84436 2082 2082 ListHashSet<RootInlineBox*> lineBoxes; 2083 2083 bool endOfInline = false; 2084 RenderObject* o = bidiFirst (this, 0, false);2084 RenderObject* o = bidiFirstNotSkippingInlines(this); 2085 2085 while (o) { 2086 2086 if (!o->isPositioned() && (o->isReplaced() || o->isFloating())) { -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r84119 r84436 754 754 // layout replaced elements 755 755 bool endOfInline = false; 756 RenderObject* o = bidiFirst (this, 0, false);756 RenderObject* o = bidiFirstNotSkippingInlines(this); 757 757 Vector<FloatWithRect> floats; 758 758 bool hasInlineChild = false; … … 1275 1275 resolver.setContext(BidiContext::create(ltr ? 0 : 1, direction, style()->unicodeBidi() == Override, FromStyleOrDOM)); 1276 1276 1277 startObj = bidiFirst (this, &resolver);1277 startObj = bidiFirstSkippingInlines(this, &resolver); 1278 1278 } 1279 1279
Note: See TracChangeset
for help on using the changeset viewer.