Bug 65086 - Fix AtomicString vs. String usage in accessibility code
Summary: Fix AtomicString vs. String usage in accessibility code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Patrick R. Gansterer
URL:
Keywords:
Depends on:
Blocks: 65172
  Show dependency treegraph
 
Reported: 2011-07-24 15:02 PDT by Patrick R. Gansterer
Modified: 2011-07-26 04:32 PDT (History)
2 users (show)

See Also:


Attachments
Patch (4.02 KB, patch)
2011-07-24 15:07 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick R. Gansterer 2011-07-24 15:02:15 PDT
Fix AtomicString vs. String usage in accessibility code
Comment 1 Patrick R. Gansterer 2011-07-24 15:07:42 PDT
Created attachment 101835 [details]
Patch
Comment 2 Darin Adler 2011-07-24 17:38:13 PDT
Comment on attachment 101835 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=101835&action=review

> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1237
> -        String idName = idVector[i];
> +        AtomicString idName(idVector[i]);
>          Element* idElement = scope->getElementById(idName);

There’s no value to having a local variable here. It should just be getElementById(idVector[i]).
Comment 3 Patrick R. Gansterer 2011-07-24 20:57:20 PDT
(In reply to comment #2)
> (From update of attachment 101835 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=101835&action=review
> 
> > Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1237
> > -        String idName = idVector[i];
> > +        AtomicString idName(idVector[i]);
> >          Element* idElement = scope->getElementById(idName);
> 
> There’s no value to having a local variable here. It should just be getElementById(idVector[i]).
We need to make a AtomicString out of String, to make the explicit cast work (I should mention that in the ChangeLog... sorry).
The alternative line would be getElementById(AtomicString(idVector[i])).
An other option is to add a split operator which generates a list of AtomicString, but I don't see much value in this.
Comment 4 Darin Adler 2011-07-25 14:53:44 PDT
(In reply to comment #3)
> An other option is to add a split operator which generates a list of AtomicString, but I don't see much value in this.

There’s a little bit of value in that.
Comment 5 WebKit Review Bot 2011-07-25 16:12:56 PDT
Comment on attachment 101835 [details]
Patch

Clearing flags on attachment: 101835

Committed r91718: <http://trac.webkit.org/changeset/91718>
Comment 6 WebKit Review Bot 2011-07-25 16:13:00 PDT
All reviewed patches have been landed.  Closing bug.