| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 unsigned FrameTree::ChildCount() const { | 149 unsigned FrameTree::ChildCount() const { |
| 150 unsigned count = 0; | 150 unsigned count = 0; |
| 151 for (Frame* result = FirstChild(); result; | 151 for (Frame* result = FirstChild(); result; |
| 152 result = result->Tree().NextSibling()) | 152 result = result->Tree().NextSibling()) |
| 153 ++count; | 153 ++count; |
| 154 return count; | 154 return count; |
| 155 } | 155 } |
| 156 | 156 |
| 157 Frame* FrameTree::Find(const AtomicString& name) const { | 157 Frame* FrameTree::Find(const AtomicString& name) const { |
| 158 // Named frame lookup should always be relative to a local frame. |
| 159 DCHECK(this_frame_->IsLocalFrame()); |
| 160 |
| 158 if (EqualIgnoringASCIICase(name, "_self") || | 161 if (EqualIgnoringASCIICase(name, "_self") || |
| 159 EqualIgnoringASCIICase(name, "_current") || name.IsEmpty()) | 162 EqualIgnoringASCIICase(name, "_current") || name.IsEmpty()) |
| 160 return this_frame_; | 163 return this_frame_; |
| 161 | 164 |
| 162 if (EqualIgnoringASCIICase(name, "_top")) | 165 if (EqualIgnoringASCIICase(name, "_top")) |
| 163 return &Top(); | 166 return &Top(); |
| 164 | 167 |
| 165 if (EqualIgnoringASCIICase(name, "_parent")) | 168 if (EqualIgnoringASCIICase(name, "_parent")) |
| 166 return Parent() ? Parent() : this_frame_.Get(); | 169 return Parent() ? Parent() : this_frame_.Get(); |
| 167 | 170 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 void showFrameTree(const blink::Frame* frame) { | 305 void showFrameTree(const blink::Frame* frame) { |
| 303 if (!frame) { | 306 if (!frame) { |
| 304 printf("Null input frame\n"); | 307 printf("Null input frame\n"); |
| 305 return; | 308 return; |
| 306 } | 309 } |
| 307 | 310 |
| 308 printFrames(&frame->Tree().Top(), frame, 0); | 311 printFrames(&frame->Tree().Top(), frame, 0); |
| 309 } | 312 } |
| 310 | 313 |
| 311 #endif | 314 #endif |
| OLD | NEW |