mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fixes crash in HTMLIFrameElement and exposes HTMLIFrameElement::src
HTMLIFrameElement was adding the observer in navigateView. If the same HTMLIFrameElement navigated multiple times HTMLIFrameElement would attach itself as an observer more than once. ObserverList doesn't like this. Also adds src as an attribute of HTMLIFrameElement so that I can do: iframe.src = xxx in script R=abarth@chromium.org Review URL: https://codereview.chromium.org/885783002
This commit is contained in:
parent
218c5f98dc
commit
e98fd07ffb
@ -35,8 +35,10 @@ void HTMLIFrameElement::insertedInto(ContainerNode* insertionPoint)
|
||||
{
|
||||
HTMLElement::insertedInto(insertionPoint);
|
||||
if (insertionPoint->inDocument()) {
|
||||
if (LocalFrame* frame = document().frame())
|
||||
if (LocalFrame* frame = document().frame()) {
|
||||
m_contentView = frame->loaderClient()->createChildFrame();
|
||||
m_contentView->AddObserver(this);
|
||||
}
|
||||
navigateView();
|
||||
}
|
||||
}
|
||||
@ -95,7 +97,6 @@ void HTMLIFrameElement::navigateView()
|
||||
m_contentView->Embed(mojo::String::From(url.string().utf8().data()),
|
||||
mojo::GetProxy(&m_services),
|
||||
mojo::MakeProxy<mojo::ServiceProvider>(exposedServicesPipe.handle1.Pass()));
|
||||
m_contentView->AddObserver(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
interface HTMLIFrameElement : HTMLElement {
|
||||
[Reflect, URL] attribute DOMString src;
|
||||
|
||||
[CallWith=ScriptState] any takeServicesHandle();
|
||||
[CallWith=ScriptState] any takeExposedServicesHandle();
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user