// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "third_party/blink/renderer/core/frame/savable_resources.h" #include "third_party/blink/public/mojom/frame/frame.mojom-blink.h" #include "third_party/blink/public/platform/platform.h" #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/html/forms/html_input_element.h" #include "third_party/blink/renderer/core/html/html_all_collection.h" #include "third_party/blink/renderer/core/html/html_frame_owner_element.h" #include "third_party/blink/renderer/core/html_names.h" #include "third_party/blink/renderer/core/input_type_names.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" namespace blink { namespace { // Returns |true| if |frame| contains (or should be assumed to contain) // a html document. bool DoesFrameContainHtmlDocument(Frame* frame, Element* element) { if (frame->IsLocalFrame()) { Document* document = LocalFrame::FromFrameToken(frame->GetFrameToken())->GetDocument(); return document->IsHTMLDocument() || document->IsXHTMLDocument(); } // Cannot inspect contents of a remote frame, so we use a heuristic: // Assume that