#include "third_party/blink/renderer/core/css/font_face.h"
#include "base/metrics/histogram_macros.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_font_face_descriptors.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_arraybuffer_arraybufferview_string.h"
#include "third_party/blink/renderer/core/css/binary_data_font_face_source.h"
#include "third_party/blink/renderer/core/css/css_font_face.h"
#include "third_party/blink/renderer/core/css/css_font_face_src_value.h"
#include "third_party/blink/renderer/core/css/css_font_family_value.h"
#include "third_party/blink/renderer/core/css/css_font_selector.h"
#include "third_party/blink/renderer/core/css/css_font_style_range_value.h"
#include "third_party/blink/renderer/core/css/css_identifier_value.h"
#include "third_party/blink/renderer/core/css/css_property_value_set.h"
#include "third_party/blink/renderer/core/css/css_unicode_range_value.h"
#include "third_party/blink/renderer/core/css/css_value_list.h"
#include "third_party/blink/renderer/core/css/css_value_pair.h"
#include "third_party/blink/renderer/core/css/local_font_face_source.h"
#include "third_party/blink/renderer/core/css/offscreen_font_selector.h"
#include "third_party/blink/renderer/core/css/parser/at_rule_descriptor_parser.h"
#include "third_party/blink/renderer/core/css/parser/css_parser.h"
#include "third_party/blink/renderer/core/css/remote_font_face_source.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/css/style_rule.h"
#include "third_party/blink/renderer/core/css_value_keywords.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/loader/render_blocking_resource_manager.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer_view.h"
#include "third_party/blink/renderer/core/workers/worker_global_scope.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/font_family_names.h"
#include "third_party/blink/renderer/platform/fonts/font_metrics_override.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/wtf/shared_buffer.h"
namespace blink {
namespace {
const CSSValue* ParseCSSValue(const ExecutionContext* context,
const String& value,
AtRuleDescriptorID descriptor_id) { … }
CSSFontFace* CreateCSSFontFace(FontFace* font_face,
const CSSValue* unicode_range) { … }
const CSSValue* ConvertFontMetricOverrideValue(const CSSValue* parsed_value) { … }
const CSSValue* ConvertSizeAdjustValue(const CSSValue* parsed_value) { … }
}
FontFace* FontFace::Create(
ExecutionContext* execution_context,
const AtomicString& family,
const V8UnionArrayBufferOrArrayBufferViewOrString* source,
const FontFaceDescriptors* descriptors) { … }
FontFace* FontFace::Create(ExecutionContext* context,
const AtomicString& family,
const String& source,
const FontFaceDescriptors* descriptors) { … }
FontFace* FontFace::Create(ExecutionContext* context,
const AtomicString& family,
DOMArrayBuffer* source,
const FontFaceDescriptors* descriptors) { … }
FontFace* FontFace::Create(ExecutionContext* context,
const AtomicString& family,
DOMArrayBufferView* source,
const FontFaceDescriptors* descriptors) { … }
FontFace* FontFace::Create(Document* document,
const StyleRuleFontFace* font_face_rule,
bool is_user_style) { … }
FontFace::FontFace(ExecutionContext* context,
const StyleRuleFontFace* style_rule,
bool is_user_style)
: … { … }
FontFace::FontFace(ExecutionContext* context,
const AtomicString& family,
const FontFaceDescriptors* descriptors)
: … { … }
FontFace::~FontFace() = default;
String FontFace::style() const { … }
String FontFace::weight() const { … }
String FontFace::stretch() const { … }
String FontFace::unicodeRange() const { … }
String FontFace::variant() const { … }
String FontFace::featureSettings() const { … }
String FontFace::display() const { … }
String FontFace::ascentOverride() const { … }
String FontFace::descentOverride() const { … }
String FontFace::lineGapOverride() const { … }
String FontFace::sizeAdjust() const { … }
void FontFace::setStyle(ExecutionContext* context,
const String& s,
ExceptionState& exception_state) { … }
void FontFace::setWeight(ExecutionContext* context,
const String& s,
ExceptionState& exception_state) { … }
void FontFace::setStretch(ExecutionContext* context,
const String& s,
ExceptionState& exception_state) { … }
void FontFace::setUnicodeRange(ExecutionContext* context,
const String& s,
ExceptionState& exception_state) { … }
void FontFace::setVariant(ExecutionContext* context,
const String& s,
ExceptionState& exception_state) { … }
void FontFace::setFeatureSettings(ExecutionContext* context,
const String& s,
ExceptionState& exception_state) { … }
void FontFace::setDisplay(ExecutionContext* context,
const String& s,
ExceptionState& exception_state) { … }
void FontFace::setAscentOverride(ExecutionContext* context,
const String& s,
ExceptionState& exception_state) { … }
void FontFace::setDescentOverride(ExecutionContext* context,
const String& s,
ExceptionState& exception_state) { … }
void FontFace::setLineGapOverride(ExecutionContext* context,
const String& s,
ExceptionState& exception_state) { … }
void FontFace::setSizeAdjust(ExecutionContext* context,
const String& s,
ExceptionState& exception_state) { … }
void FontFace::SetPropertyFromString(const ExecutionContext* context,
const String& s,
AtRuleDescriptorID descriptor_id,
ExceptionState* exception_state) { … }
bool FontFace::SetPropertyFromStyle(const CSSPropertyValueSet& properties,
AtRuleDescriptorID property_id) { … }
bool FontFace::SetPropertyValue(const CSSValue* value,
AtRuleDescriptorID descriptor_id) { … }
void FontFace::SetFamilyValue(const CSSFontFamilyValue& family_value) { … }
String FontFace::status() const { … }
void FontFace::SetLoadStatus(LoadStatusType status) { … }
void FontFace::RunCallbacks() { … }
void FontFace::SetError(DOMException* error) { … }
ScriptPromise<FontFace> FontFace::FontStatusPromise(ScriptState* script_state) { … }
ScriptPromise<FontFace> FontFace::load(ScriptState* script_state) { … }
void FontFace::LoadWithCallback(LoadFontCallback* callback) { … }
void FontFace::AddCallback(LoadFontCallback* callback) { … }
FontSelectionCapabilities FontFace::GetFontSelectionCapabilities() const { … }
size_t FontFace::ApproximateBlankCharacterCount() const { … }
bool ContextAllowsDownload(ExecutionContext* context) { … }
void FontFace::InitCSSFontFace(ExecutionContext* context, const CSSValue& src) { … }
void FontFace::InitCSSFontFace(ExecutionContext* context,
const unsigned char* data,
size_t size) { … }
void FontFace::Trace(Visitor* visitor) const { … }
bool FontFace::HadBlankText() const { … }
bool FontFace::HasPendingActivity() const { … }
FontDisplay FontFace::GetFontDisplay() const { … }
void FontFace::DidBeginImperativeLoad() { … }
FontMetricsOverride FontFace::GetFontMetricsOverride() const { … }
float FontFace::GetSizeAdjust() const { … }
Document* FontFace::GetDocument() const { … }
}