Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
| index 01fc2ac62b9849ede2e4d98b0d73447fdedc8672..bd7708e660941c1d7c6fc690c3ccfeec0cc525b1 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp |
| @@ -37,6 +37,7 @@ |
| #include "core/frame/Deprecation.h" |
| #include "core/frame/ImageBitmap.h" |
| #include "core/frame/LocalDOMWindow.h" |
| +#include "core/html/FormAssociated.h" |
| #include "core/html/HTMLAnchorElement.h" |
| #include "core/html/HTMLCanvasElement.h" |
| #include "core/html/HTMLFormElement.h" |
| @@ -99,12 +100,6 @@ HTMLImageElement::HTMLImageElement(Document& document, |
| m_isFallbackImage(false), |
| m_referrerPolicy(ReferrerPolicyDefault) { |
| setHasCustomStyleCallbacks(); |
| - if (form && form->isConnected()) { |
| - m_form = form; |
| - m_formWasSetByParser = true; |
| - m_form->associate(*this); |
| - m_form->didAssociateByParser(); |
| - } |
| } |
| HTMLImageElement* HTMLImageElement::create(Document& document) { |
| @@ -891,4 +886,13 @@ IntSize HTMLImageElement::bitmapSourceSize() const { |
| return IntSize(lSize.width().toInt(), lSize.height().toInt()); |
| } |
| +void HTMLImageElement::setAssociatedForm(HTMLFormElement* form) { |
|
tkent
2016/12/05 01:53:50
You move the association code to setAssociatedForm
|
| + if (form && form->isConnected()) { |
| + m_form = form; |
| + m_formWasSetByParser = true; |
| + m_form->associate(*this); |
| + m_form->didAssociateByParser(); |
| + } |
| +}; |
| + |
| } // namespace blink |