frames[x].name returns frame element id, not frame name.
(In reply to comment #0) Radar bug: 4170960
Created attachment 2908 [details] Patch Proposed fix.
Created attachment 2909 [details] layout test Proposed layout test.