Chromium Code Reviews| Index: third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp |
| diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp |
| index 4395577864592aabfa38b4379b1469be409b09a1..246ca3ac0a3ed2b9ee5b0ed1eba1f1d50515255b 100644 |
| --- a/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp |
| +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp |
| @@ -4,6 +4,7 @@ |
| #include "core/inspector/InspectorDOMSnapshotAgent.h" |
| +#include "core/InputTypeNames.h" |
| #include "core/css/CSSComputedStyleDeclaration.h" |
| #include "core/dom/Attribute.h" |
| #include "core/dom/AttributeCollection.h" |
| @@ -16,8 +17,11 @@ |
| #include "core/dom/QualifiedName.h" |
| #include "core/frame/LocalFrame.h" |
| #include "core/html/HTMLFrameOwnerElement.h" |
| +#include "core/html/HTMLInputElement.h" |
| #include "core/html/HTMLLinkElement.h" |
| +#include "core/html/HTMLOptionElement.h" |
| #include "core/html/HTMLTemplateElement.h" |
| +#include "core/html/HTMLTextAreaElement.h" |
| #include "core/inspector/IdentifiersFactory.h" |
| #include "core/inspector/InspectedFrames.h" |
| #include "core/inspector/InspectorDOMAgent.h" |
| @@ -174,7 +178,7 @@ int InspectorDOMSnapshotAgent::VisitNode(Node* node) { |
| value->setAttributes(BuildArrayForElementAttributes(element)); |
| if (node->IsFrameOwnerElement()) { |
| - HTMLFrameOwnerElement* frame_owner = ToHTMLFrameOwnerElement(node); |
| + const HTMLFrameOwnerElement* frame_owner = ToHTMLFrameOwnerElement(node); |
| if (LocalFrame* frame = |
| frame_owner->ContentFrame() && |
| frame_owner->ContentFrame()->IsLocalFrame() |
| @@ -194,7 +198,7 @@ int InspectorDOMSnapshotAgent::VisitNode(Node* node) { |
| } |
| if (isHTMLLinkElement(*element)) { |
| - HTMLLinkElement& link_element = toHTMLLinkElement(*element); |
| + const HTMLLinkElement& link_element = toHTMLLinkElement(*element); |
| if (link_element.IsImport() && link_element.import() && |
| InspectorDOMAgent::InnerParentNode(link_element.import()) == |
| link_element) { |
| @@ -207,6 +211,28 @@ int InspectorDOMSnapshotAgent::VisitNode(Node* node) { |
| VisitNode(toHTMLTemplateElement(*element).content())); |
| } |
| + if (isHTMLTextAreaElement(*element)) { |
| + const HTMLTextAreaElement& text_area_element = |
| + toHTMLTextAreaElement(*element); |
| + if (!text_area_element.value().IsEmpty()) |
|
pfeldman
2017/07/10 19:00:44
I think you should set it regardless, it can be im
dvallet
2017/07/11 00:26:07
Done.
|
| + value->setTextValue(text_area_element.value()); |
| + } |
| + |
| + if (isHTMLInputElement(*element)) { |
| + const HTMLInputElement& input_element = toHTMLInputElement(*element); |
| + if (!input_element.value().IsEmpty()) |
| + value->setInputValue(input_element.value()); |
|
pfeldman
2017/07/10 19:00:44
I would put it into the else branch and also not c
dvallet
2017/07/11 00:26:07
Radio and checkbox elements can have also values a
|
| + if ((input_element.type() == InputTypeNames::radio) || |
| + (input_element.type() == InputTypeNames::checkbox)) { |
| + value->setInputChecked(input_element.checked()); |
| + } |
| + } |
| + |
| + if (isHTMLOptionElement(*element)) { |
| + const HTMLOptionElement& option_element = toHTMLOptionElement(*element); |
| + value->setInputSelected(option_element.Selected()); |
| + } |
| + |
| if (element->GetPseudoId()) { |
| protocol::DOM::PseudoType pseudo_type; |
| if (InspectorDOMAgent::GetPseudoElementType(element->GetPseudoId(), |