#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/html/html_meta_element.h"
#include "base/metrics/histogram_macros.h"
#include "base/trace_event/typed_macros.h"
#include "third_party/blink/public/mojom/frame/color_scheme.mojom-blink.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/viewport_data.h"
#include "third_party/blink/renderer/core/html/client_hints_util.h"
#include "third_party/blink/renderer/core/html/html_head_element.h"
#include "third_party/blink/renderer/core/html/parser/html_parser_idioms.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/loader/frame_client_hints_preferences_context.h"
#include "third_party/blink/renderer/core/loader/frame_fetch_context.h"
#include "third_party/blink/renderer/core/loader/http_equiv.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/loader/fetch/client_hints_preferences.h"
#include "third_party/blink/renderer/platform/weborigin/security_policy.h"
#include "third_party/blink/renderer/platform/wtf/text/string_to_number.h"
namespace blink {
HTMLMetaElement::HTMLMetaElement(Document& document,
const CreateElementFlags flags)
: … { … }
static bool IsInvalidSeparator(UChar c) { … }
static bool IsSeparator(UChar c) { … }
void HTMLMetaElement::ParseViewportContentAttribute(
const String& content,
ViewportDescription& viewport_description,
Document* document,
bool viewport_meta_zero_values_quirk) { … }
static inline float ClampLengthValue(float value) { … }
static inline float ClampScaleValue(float value) { … }
float HTMLMetaElement::ParsePositiveNumber(Document* document,
bool report_warnings,
const String& key_string,
const String& value_string,
bool* ok) { … }
Length HTMLMetaElement::ParseViewportValueAsLength(Document* document,
bool report_warnings,
const String& key_string,
const String& value_string) { … }
float HTMLMetaElement::ParseViewportValueAsZoom(
Document* document,
bool report_warnings,
const String& key_string,
const String& value_string,
bool& computed_value_matches_parsed_value,
bool viewport_meta_zero_values_quirk) { … }
bool HTMLMetaElement::ParseViewportValueAsUserZoom(
Document* document,
bool report_warnings,
const String& key_string,
const String& value_string,
bool& computed_value_matches_parsed_value) { … }
float HTMLMetaElement::ParseViewportValueAsDPI(Document* document,
bool report_warnings,
const String& key_string,
const String& value_string) { … }
blink::mojom::ViewportFit HTMLMetaElement::ParseViewportFitValueAsEnum(
bool& unknown_value,
const String& value_string) { … }
std::optional<ui::mojom::blink::VirtualKeyboardMode>
HTMLMetaElement::ParseVirtualKeyboardValueAsEnum(const String& value) { … }
void HTMLMetaElement::ProcessViewportKeyValuePair(
Document* document,
bool report_warnings,
const String& key_string,
const String& value_string,
bool viewport_meta_zero_values_quirk,
ViewportDescription& description) { … }
static const char* ViewportErrorMessageTemplate(ViewportErrorCode error_code) { … }
static mojom::ConsoleMessageLevel ViewportErrorMessageLevel(
ViewportErrorCode error_code) { … }
void HTMLMetaElement::ReportViewportWarning(Document* document,
ViewportErrorCode error_code,
const String& replacement1,
const String& replacement2) { … }
void HTMLMetaElement::GetViewportDescriptionFromContentAttribute(
const String& content,
ViewportDescription& description,
Document* document,
bool viewport_meta_zero_values_quirk) { … }
void HTMLMetaElement::ProcessViewportContentAttribute(
const String& content,
ViewportDescription::Type origin) { … }
void HTMLMetaElement::NameRemoved(const AtomicString& name_value) { … }
void HTMLMetaElement::ParseAttribute(
const AttributeModificationParams& params) { … }
Node::InsertionNotificationRequest HTMLMetaElement::InsertedInto(
ContainerNode& insertion_point) { … }
void HTMLMetaElement::DidNotifySubtreeInsertionsToDocument() { … }
void HTMLMetaElement::RemovedFrom(ContainerNode& insertion_point) { … }
static bool InDocumentHead(HTMLMetaElement* element) { … }
void HTMLMetaElement::ProcessHttpEquiv() { … }
enum class ContentClassificationOpenGraph { … };
ContentClassificationOpenGraph GetContentClassification(
const AtomicString& open_graph_type) { … }
void HTMLMetaElement::ProcessContent() { … }
WTF::TextEncoding HTMLMetaElement::ComputeEncoding() const { … }
const AtomicString& HTMLMetaElement::Content() const { … }
const AtomicString& HTMLMetaElement::HttpEquiv() const { … }
const AtomicString& HTMLMetaElement::Media() const { … }
const AtomicString& HTMLMetaElement::GetName() const { … }
const AtomicString& HTMLMetaElement::Property() const { … }
const AtomicString& HTMLMetaElement::Itemprop() const { … }
void HTMLMetaElement::ProcessMetaCH(Document& document,
const AtomicString& content,
network::MetaCHType type,
bool is_doc_preloader,
bool is_sync_parser) { … }
void HTMLMetaElement::FinishParsingChildren() { … }
}