[Webkit-unassigned] [Bug 25452] AX: Don't create addition space AXStaticText element for every bold or link tag

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 28 11:51:52 PDT 2009


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


darin at apple.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #29855|                            |review-
               Flag|                            |
  Attachment #29855|1                           |0
        is obsolete|                            |




------- Comment #2 from darin at apple.com  2009-04-28 11:51 PDT -------
(From update of attachment 29855)
> +        // text elements that are just empty whitespace should not be returned
> +        String text = renderText->text()->simplifyWhiteSpace();
> +        if (text.isNull() || text.isEmpty())
> +            return true;
> +        return false;

This should just be:

    return renderText->text()->simplifyWhiteSpace().isEmpty();

There's no need for a separate isNull check since null strings are also
guaranteed to be empty. But really, to be efficient, it should be:

    return renderText->text()->containsOnlyWhitespace();

Unfortunately, that function is currently defined for StringImpl* but not for
String. Since RenderText guarantees that text() will never return null (you can
see assertions to that effect inside the class), you can do this:

    return renderText->text()->impl()->containsOnlyWhitespace();

I’ll say review- because it would be better to do the more efficient version.


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



More information about the webkit-unassigned mailing list