OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 PassRefPtr<LocalFrame> WebFrameImpl::createChildFrame(const FrameLoadRequest& re
quest, HTMLFrameOwnerElement* ownerElement) | 1681 PassRefPtr<LocalFrame> WebFrameImpl::createChildFrame(const FrameLoadRequest& re
quest, HTMLFrameOwnerElement* ownerElement) |
1682 { | 1682 { |
1683 ASSERT(m_client); | 1683 ASSERT(m_client); |
1684 WebFrameImpl* webframe = toWebFrameImpl(m_client->createChildFrame(this, req
uest.frameName())); | 1684 WebFrameImpl* webframe = toWebFrameImpl(m_client->createChildFrame(this, req
uest.frameName())); |
1685 if (!webframe) | 1685 if (!webframe) |
1686 return nullptr; | 1686 return nullptr; |
1687 | 1687 |
1688 RefPtr<LocalFrame> childFrame = LocalFrame::create(&webframe->m_frameLoaderC
lientImpl, frame()->host(), ownerElement); | 1688 RefPtr<LocalFrame> childFrame = LocalFrame::create(&webframe->m_frameLoaderC
lientImpl, frame()->host(), ownerElement); |
1689 webframe->setWebCoreFrame(childFrame); | 1689 webframe->setWebCoreFrame(childFrame); |
1690 | 1690 |
1691 childFrame->tree().setName(request.frameName()); | 1691 // FIXME: Using subResourceAttributeName as fallback is not a perfect |
| 1692 // solution. subResourceAttributeName returns just one attribute name. The |
| 1693 // element might not have the attribute, and there might be other attributes |
| 1694 // which can identify the element. |
| 1695 childFrame->tree().setName(request.frameName(), ownerElement->getAttribute(o
wnerElement->subResourceAttributeName())); |
1692 | 1696 |
1693 // FIXME: This comment is not quite accurate anymore. | 1697 // FIXME: This comment is not quite accurate anymore. |
1694 // LocalFrame::init() can trigger onload event in the parent frame, | 1698 // LocalFrame::init() can trigger onload event in the parent frame, |
1695 // which may detach this frame and trigger a null-pointer access | 1699 // which may detach this frame and trigger a null-pointer access |
1696 // in FrameTree::removeChild. Move init() after appendChild call | 1700 // in FrameTree::removeChild. Move init() after appendChild call |
1697 // so that webframe->mFrame is in the tree before triggering | 1701 // so that webframe->mFrame is in the tree before triggering |
1698 // onload event handler. | 1702 // onload event handler. |
1699 // Because the event handler may set webframe->mFrame to null, | 1703 // Because the event handler may set webframe->mFrame to null, |
1700 // it is necessary to check the value after calling init() and | 1704 // it is necessary to check the value after calling init() and |
1701 // return without loading URL. | 1705 // return without loading URL. |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 | 1971 |
1968 void WebFrameImpl::invalidateAll() const | 1972 void WebFrameImpl::invalidateAll() const |
1969 { | 1973 { |
1970 ASSERT(frame() && frame()->view()); | 1974 ASSERT(frame() && frame()->view()); |
1971 FrameView* view = frame()->view(); | 1975 FrameView* view = frame()->view(); |
1972 view->invalidateRect(view->frameRect()); | 1976 view->invalidateRect(view->frameRect()); |
1973 invalidateScrollbar(); | 1977 invalidateScrollbar(); |
1974 } | 1978 } |
1975 | 1979 |
1976 } // namespace blink | 1980 } // namespace blink |
OLD | NEW |