Changeset 167447 in webkit
- Timestamp:
- Apr 17, 2014 12:39:22 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167445 r167447 1 2014-04-17 David Kilzer <ddkilzer@apple.com> 2 3 Tidy up isIsolatedInline() and highestContainingIsolateWithinRoot() 4 <http://webkit.org/b/131117> 5 6 Reviewed by Daniel Bates. 7 8 Based on review feedback for r166650. 9 10 * rendering/InlineIterator.h: 11 (WebCore::isIsolatedInline): 12 - Switch argument to a reference since it is never called with a 13 nullptr. 14 (WebCore::highestContainingIsolateWithinRoot): 15 - Switch first argument to a reference since it's never a 16 nullptr. 17 - Use nullptr for pointer initialization. 18 - Switch while() loop to for() loop. Pass reference to 19 isIsolatedInline(). 20 (WebCore::numberOfIsolateAncestors): 21 - Switch while() loop to for() loop. Pass reference to 22 isIsolatedInline(). 23 * rendering/RenderBlockLineLayout.cpp: 24 (WebCore::constructBidiRunsForSegment): 25 - Rename startObj to startObject. 26 - No longer need to pass the address of startObject here. 27 1 28 2014-04-17 Andreas Kling <akling@apple.com> 2 29 -
trunk/Source/WebCore/rendering/InlineIterator.h
r166650 r167447 443 443 } 444 444 445 static inline bool isIsolatedInline(RenderObject* object) 446 { 447 ASSERT(object); 448 return object->isRenderInline() && isIsolated(object->style().unicodeBidi()); 449 } 450 451 static inline RenderObject* highestContainingIsolateWithinRoot(RenderObject* object, RenderObject* root) 452 { 453 ASSERT(object); 454 RenderObject* containingIsolateObject = 0; 455 while (object && object != root) { 456 if (isIsolatedInline(object)) 445 static inline bool isIsolatedInline(RenderObject& object) 446 { 447 return object.isRenderInline() && isIsolated(object.style().unicodeBidi()); 448 } 449 450 static inline RenderObject* highestContainingIsolateWithinRoot(RenderObject& initialObject, RenderObject* root) 451 { 452 RenderObject* containingIsolateObject = nullptr; 453 for (RenderObject* object = &initialObject; object && object != root; object = object->parent()) { 454 if (isIsolatedInline(*object)) 457 455 containingIsolateObject = object; 458 459 object = object->parent();460 456 } 461 457 return containingIsolateObject; … … 464 460 static inline unsigned numberOfIsolateAncestors(const InlineIterator& iter) 465 461 { 466 RenderObject* object = iter.renderer();467 if (!object)468 return 0;469 462 unsigned count = 0; 470 while (object && object != iter.root()) { 471 if (isIsolatedInline(object)) 463 typedef RenderObject* RenderObjectPtr; 464 for (RenderObjectPtr object = iter.renderer(), root = iter.root(); object && object != root; object = object->parent()) { 465 if (isIsolatedInline(*object)) 472 466 count++; 473 object = object->parent();474 467 } 475 468 return count; -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r167283 r167447 853 853 topResolver.isolatedRuns().removeLast(); 854 854 855 RenderObject& startObj = isolatedRun->renderer();855 RenderObject& startObject = isolatedRun->renderer(); 856 856 857 857 // Only inlines make sense with unicode-bidi: isolate (blocks are already isolated). … … 860 860 // to take a RenderObject and do this logic there, but that would be a layering 861 861 // violation for BidiResolver (which knows nothing about RenderObject). 862 RenderInline* isolatedInline = toRenderInline(highestContainingIsolateWithinRoot( &startObj, currentRoot));862 RenderInline* isolatedInline = toRenderInline(highestContainingIsolateWithinRoot(startObject, currentRoot)); 863 863 ASSERT(isolatedInline); 864 864 … … 874 874 isolatedResolver.setStatus(BidiStatus(direction, isOverride(unicodeBidi))); 875 875 876 setUpResolverToResumeInIsolate(isolatedResolver, isolatedInline, &startObj );876 setUpResolverToResumeInIsolate(isolatedResolver, isolatedInline, &startObject); 877 877 878 878 // The starting position is the beginning of the first run within the isolate that was identified 879 879 // during the earlier call to createBidiRunsForLine. This can be but is not necessarily the 880 880 // first run within the isolate. 881 InlineIterator iter = InlineIterator(isolatedInline, &startObj , isolatedRun->m_start);881 InlineIterator iter = InlineIterator(isolatedInline, &startObject, isolatedRun->m_start); 882 882 isolatedResolver.setPositionIgnoringNestedIsolates(iter); 883 883
Note: See TracChangeset
for help on using the changeset viewer.