Changeset 168279 in webkit


Ignore:
Timestamp:
May 5, 2014 4:32:34 AM (10 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r167447 - Tidy up isIsolatedInline() and highestContainingIsolateWithinRoot()
<http://webkit.org/b/131117>

Reviewed by Daniel Bates.

Based on review feedback for r166650.

  • rendering/InlineIterator.h:

(WebCore::isIsolatedInline):

  • Switch argument to a reference since it is never called with a nullptr.

(WebCore::highestContainingIsolateWithinRoot):

  • Switch first argument to a reference since it's never a nullptr.
  • Use nullptr for pointer initialization.
  • Switch while() loop to for() loop. Pass reference to isIsolatedInline().

(WebCore::numberOfIsolateAncestors):

  • Switch while() loop to for() loop. Pass reference to isIsolatedInline().
  • rendering/RenderBlockLineLayout.cpp:

(WebCore::constructBidiRunsForSegment):

  • Rename startObj to startObject.
  • No longer need to pass the address of startObject here.
Location:
releases/WebKitGTK/webkit-2.4/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.4/Source/WebCore/ChangeLog

    r168278 r168279  
     12014-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
    1282014-04-02  David Kilzer  <ddkilzer@apple.com>
    229
  • releases/WebKitGTK/webkit-2.4/Source/WebCore/rendering/InlineIterator.h

    r168278 r168279  
    409409}
    410410
    411 static inline bool isIsolatedInline(RenderObject* object)
    412 {
    413     ASSERT(object);
    414     return object->isRenderInline() && isIsolated(object->style().unicodeBidi());
    415 }
    416 
    417 static inline RenderObject* highestContainingIsolateWithinRoot(RenderObject* object, RenderObject* root)
    418 {
    419     ASSERT(object);
    420     RenderObject* containingIsolateObject = 0;
    421     while (object && object != root) {
    422         if (isIsolatedInline(object))
     411static inline bool isIsolatedInline(RenderObject& object)
     412{
     413    return object.isRenderInline() && isIsolated(object.style().unicodeBidi());
     414}
     415
     416static inline RenderObject* highestContainingIsolateWithinRoot(RenderObject& initialObject, RenderObject* root)
     417{
     418    RenderObject* containingIsolateObject = nullptr;
     419    for (RenderObject* object = &initialObject; object && object != root; object = object->parent()) {
     420        if (isIsolatedInline(*object))
    423421            containingIsolateObject = object;
    424 
    425         object = object->parent();
    426422    }
    427423    return containingIsolateObject;
     
    430426static inline unsigned numberOfIsolateAncestors(const InlineIterator& iter)
    431427{
    432     RenderObject* object = iter.renderer();
    433     if (!object)
    434         return 0;
    435428    unsigned count = 0;
    436     while (object && object != iter.root()) {
    437         if (isIsolatedInline(object))
     429    typedef RenderObject* RenderObjectPtr;
     430    for (RenderObjectPtr object = iter.renderer(), root = iter.root(); object && object != root; object = object->parent()) {
     431        if (isIsolatedInline(*object))
    438432            count++;
    439         object = object->parent();
    440433    }
    441434    return count;
  • releases/WebKitGTK/webkit-2.4/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r168278 r168279  
    897897        topResolver.isolatedRuns().removeLast();
    898898
    899         RenderObject& startObj = isolatedRun->renderer();
     899        RenderObject& startObject = isolatedRun->renderer();
    900900
    901901        // Only inlines make sense with unicode-bidi: isolate (blocks are already isolated).
     
    904904        // to take a RenderObject and do this logic there, but that would be a layering
    905905        // violation for BidiResolver (which knows nothing about RenderObject).
    906         RenderInline* isolatedInline = toRenderInline(highestContainingIsolateWithinRoot(&startObj, currentRoot));
     906        RenderInline* isolatedInline = toRenderInline(highestContainingIsolateWithinRoot(startObject, currentRoot));
    907907        ASSERT(isolatedInline);
    908908
     
    918918        isolatedResolver.setStatus(BidiStatus(direction, isOverride(unicodeBidi)));
    919919
    920         setUpResolverToResumeInIsolate(isolatedResolver, isolatedInline, &startObj);
     920        setUpResolverToResumeInIsolate(isolatedResolver, isolatedInline, &startObject);
    921921
    922922        // The starting position is the beginning of the first run within the isolate that was identified
    923923        // during the earlier call to createBidiRunsForLine. This can be but is not necessarily the
    924924        // first run within the isolate.
    925         InlineIterator iter = InlineIterator(isolatedInline, &startObj, isolatedRun->m_start);
     925        InlineIterator iter = InlineIterator(isolatedInline, &startObject, isolatedRun->m_start);
    926926        isolatedResolver.setPositionIgnoringNestedIsolates(iter);
    927927
Note: See TracChangeset for help on using the changeset viewer.