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

Unified Diff: third_party/WebKit/Source/core/html/HTMLImageElement.cpp

Issue 2537133005: New interface and function for form association (Closed)
Patch Set: Add interface to ListedElement and HTMLImageElement Created 4 years 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698