Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: third_party/WebKit/Source/core/page/FrameTree.cpp

Issue 2785063002: Make browsing context keywords case-insensitive. (Closed)
Patch Set: Rebased Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/page/CreateWindow.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 unsigned FrameTree::childCount() const { 126 unsigned FrameTree::childCount() const {
127 unsigned count = 0; 127 unsigned count = 0;
128 for (Frame* result = firstChild(); result; 128 for (Frame* result = firstChild(); result;
129 result = result->tree().nextSibling()) 129 result = result->tree().nextSibling())
130 ++count; 130 ++count;
131 return count; 131 return count;
132 } 132 }
133 133
134 Frame* FrameTree::find(const AtomicString& name) const { 134 Frame* FrameTree::find(const AtomicString& name) const {
135 if (name == "_self" || name == "_current" || name.isEmpty()) 135 if (equalIgnoringASCIICase(name, "_self") ||
136 equalIgnoringASCIICase(name, "_current") || name.isEmpty())
136 return m_thisFrame; 137 return m_thisFrame;
137 138
138 if (name == "_top") 139 if (equalIgnoringASCIICase(name, "_top"))
139 return top(); 140 return top();
140 141
141 if (name == "_parent") 142 if (equalIgnoringASCIICase(name, "_parent"))
142 return parent() ? parent() : m_thisFrame.get(); 143 return parent() ? parent() : m_thisFrame.get();
143 144
144 // Since "_blank" should never be any frame's name, the following just amounts 145 // Since "_blank" should never be any frame's name, the following just amounts
145 // to an optimization. 146 // to an optimization.
146 if (name == "_blank") 147 if (equalIgnoringASCIICase(name, "_blank"))
147 return nullptr; 148 return nullptr;
148 149
149 // Search subtree starting with this frame first. 150 // Search subtree starting with this frame first.
150 for (Frame* frame = m_thisFrame; frame; 151 for (Frame* frame = m_thisFrame; frame;
151 frame = frame->tree().traverseNext(m_thisFrame)) { 152 frame = frame->tree().traverseNext(m_thisFrame)) {
152 if (frame->tree().name() == name) 153 if (frame->tree().name() == name)
153 return frame; 154 return frame;
154 } 155 }
155 156
156 // Search the entire tree for this page next. 157 // Search the entire tree for this page next.
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 void showFrameTree(const blink::Frame* frame) { 278 void showFrameTree(const blink::Frame* frame) {
278 if (!frame) { 279 if (!frame) {
279 printf("Null input frame\n"); 280 printf("Null input frame\n");
280 return; 281 return;
281 } 282 }
282 283
283 printFrames(frame->tree().top(), frame, 0); 284 printFrames(frame->tree().top(), frame, 0);
284 } 285 }
285 286
286 #endif 287 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/CreateWindow.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698