OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 // for empty frame names. Otherwise, illegitimate window.open() calls with | 1630 // for empty frame names. Otherwise, illegitimate window.open() calls with |
1631 // no name will pass right through the popup blocker. | 1631 // no name will pass right through the popup blocker. |
1632 if (frame_name.IsEmpty() || !GetFrame()->Tree().Find(frame_name)) | 1632 if (frame_name.IsEmpty() || !GetFrame()->Tree().Find(frame_name)) |
1633 return nullptr; | 1633 return nullptr; |
1634 } | 1634 } |
1635 | 1635 |
1636 // Get the target frame for the special cases of _top and _parent. | 1636 // Get the target frame for the special cases of _top and _parent. |
1637 // In those cases, we schedule a location change right now and return early. | 1637 // In those cases, we schedule a location change right now and return early. |
1638 Frame* target_frame = nullptr; | 1638 Frame* target_frame = nullptr; |
1639 if (EqualIgnoringASCIICase(frame_name, "_top")) { | 1639 if (EqualIgnoringASCIICase(frame_name, "_top")) { |
1640 target_frame = GetFrame()->Tree().Top(); | 1640 target_frame = &GetFrame()->Tree().Top(); |
1641 } else if (EqualIgnoringASCIICase(frame_name, "_parent")) { | 1641 } else if (EqualIgnoringASCIICase(frame_name, "_parent")) { |
1642 if (Frame* parent = GetFrame()->Tree().Parent()) | 1642 if (Frame* parent = GetFrame()->Tree().Parent()) |
1643 target_frame = parent; | 1643 target_frame = parent; |
1644 else | 1644 else |
1645 target_frame = GetFrame(); | 1645 target_frame = GetFrame(); |
1646 } | 1646 } |
1647 | 1647 |
1648 if (target_frame) { | 1648 if (target_frame) { |
1649 if (!active_document->GetFrame() || | 1649 if (!active_document->GetFrame() || |
1650 !active_document->GetFrame()->CanNavigate(*target_frame)) | 1650 !active_document->GetFrame()->CanNavigate(*target_frame)) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 DOMWindow::Trace(visitor); | 1693 DOMWindow::Trace(visitor); |
1694 Supplementable<LocalDOMWindow>::Trace(visitor); | 1694 Supplementable<LocalDOMWindow>::Trace(visitor); |
1695 } | 1695 } |
1696 | 1696 |
1697 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { | 1697 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { |
1698 visitor->TraceWrappers(custom_elements_); | 1698 visitor->TraceWrappers(custom_elements_); |
1699 DOMWindow::TraceWrappers(visitor); | 1699 DOMWindow::TraceWrappers(visitor); |
1700 } | 1700 } |
1701 | 1701 |
1702 } // namespace blink | 1702 } // namespace blink |
OLD | NEW |