[Webkit-unassigned] [Bug 45687] New: [GTK] Code simplification needed in Atk Wrapper

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 13 11:01:50 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=45687

           Summary: [GTK] Code simplification needed in Atk Wrapper
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Accessibility
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: msanchez at igalia.com
                CC: mrobinson at webkit.org


The following piece of code in WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp should be simplified:

    // Set preliminar values for start and end offsets
    startOffset = nodeRangeStart.offsetInContainerNode();
    endOffset = nodeRangeEnd.offsetInContainerNode();

    // If the end node is different then the start node, iterate over
    // those among them to build the effective value for endOffset
    if (nodeRangeStart.anchorNode() != nodeRangeEnd.anchorNode()) {
        RefPtr<Range> nodeRange = Range::create(node->document(), nodeRangeStart, positionBeforeNode(nodeRangeEnd.anchorNode()));
        for (TextIterator it(nodeRange.get()); !it.atEnd(); it.advance()) {
            RefPtr<Range> range = it.range();
            if (range->startContainer()->isTextNode())
                endOffset += range->endOffset();
        }
    }


This could be simplified using TextIterator::rangeLength(), making the code cleaner and more readable

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list