#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/css/font_size_functions.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/frame/settings.h"
#include "third_party/blink/renderer/platform/fonts/font_description.h"
#include "third_party/blink/renderer/platform/fonts/simple_font_data.h"
namespace blink {
float FontSizeFunctions::GetComputedSizeFromSpecifiedSize(
const Document* document,
float zoom_factor,
bool is_absolute_size,
float specified_size,
ApplyMinimumFontSize apply_minimum_font_size) { … }
const int kFontSizeTableMax = …;
const int kDefaultMediumFontSize = …;
const int kFontSizeTableMin = …;
const int kTotalKeywords = …;
static const int kQuirksFontSizeTable[kFontSizeTableMax - kFontSizeTableMin +
1][kTotalKeywords] = …;
static const int kStrictFontSizeTable[kFontSizeTableMax - kFontSizeTableMin +
1][kTotalKeywords] = …;
static const float kFontSizeFactors[kTotalKeywords] = …;
static int inline RowFromMediumFontSizeInRange(const Settings* settings,
bool quirks_mode,
bool is_monospace,
int& medium_size) { … }
float FontSizeFunctions::FontSizeForKeyword(const Document* document,
unsigned keyword,
bool is_monospace) { … }
template <typename T>
static int FindNearestLegacyFontSize(int pixel_font_size,
const T* table,
int multiplier) { … }
int FontSizeFunctions::LegacyFontSize(const Document* document,
int pixel_font_size,
bool is_monospace) { … }
static float AspectValue(const SimpleFontData& font_data,
FontSizeAdjust::Metric metric,
float computed_size) { … }
std::optional<float> FontSizeFunctions::FontAspectValue(
const SimpleFontData* font_data,
FontSizeAdjust::Metric metric,
float computed_size) { … }
std::optional<float> FontSizeFunctions::MetricsMultiplierAdjustedFontSize(
const SimpleFontData* font_data,
const FontDescription& font_description) { … }
}