#include "core/fxcrt/css/cfx_cssstyleselector.h"
#include <algorithm>
#include <utility>
#include "core/fxcrt/check.h"
#include "core/fxcrt/containers/adapters.h"
#include "core/fxcrt/css/cfx_csscolorvalue.h"
#include "core/fxcrt/css/cfx_csscomputedstyle.h"
#include "core/fxcrt/css/cfx_csscustomproperty.h"
#include "core/fxcrt/css/cfx_cssdeclaration.h"
#include "core/fxcrt/css/cfx_cssenumvalue.h"
#include "core/fxcrt/css/cfx_csspropertyholder.h"
#include "core/fxcrt/css/cfx_cssselector.h"
#include "core/fxcrt/css/cfx_cssstylesheet.h"
#include "core/fxcrt/css/cfx_csssyntaxparser.h"
#include "core/fxcrt/css/cfx_cssvaluelist.h"
CFX_CSSStyleSelector::CFX_CSSStyleSelector() = default;
CFX_CSSStyleSelector::~CFX_CSSStyleSelector() = default;
void CFX_CSSStyleSelector::SetDefaultFontSize(float fFontSize) { … }
RetainPtr<CFX_CSSComputedStyle> CFX_CSSStyleSelector::CreateComputedStyle(
const CFX_CSSComputedStyle* pParentStyle) { … }
void CFX_CSSStyleSelector::SetUAStyleSheet(
std::unique_ptr<CFX_CSSStyleSheet> pSheet) { … }
void CFX_CSSStyleSelector::UpdateStyleIndex() { … }
std::vector<const CFX_CSSDeclaration*> CFX_CSSStyleSelector::MatchDeclarations(
const WideString& tagname) { … }
bool CFX_CSSStyleSelector::MatchSelector(const WideString& tagname,
CFX_CSSSelector* pSel) { … }
void CFX_CSSStyleSelector::ComputeStyle(
const std::vector<const CFX_CSSDeclaration*>& declArray,
const WideString& styleString,
const WideString& alignString,
CFX_CSSComputedStyle* pDest) { … }
void CFX_CSSStyleSelector::ApplyDeclarations(
const std::vector<const CFX_CSSDeclaration*>& declArray,
const CFX_CSSDeclaration* extraDecl,
CFX_CSSComputedStyle* pComputedStyle) { … }
void CFX_CSSStyleSelector::ExtractValues(
const CFX_CSSDeclaration* decl,
std::vector<const CFX_CSSPropertyHolder*>* importants,
std::vector<const CFX_CSSPropertyHolder*>* normals,
std::vector<const CFX_CSSCustomProperty*>* custom) { … }
void CFX_CSSStyleSelector::AppendInlineStyle(CFX_CSSDeclaration* pDecl,
const WideString& style) { … }
void CFX_CSSStyleSelector::ApplyProperty(CFX_CSSProperty eProperty,
const RetainPtr<CFX_CSSValue>& pValue,
CFX_CSSComputedStyle* pComputedStyle) { … }
CFX_CSSDisplay CFX_CSSStyleSelector::ToDisplay(CFX_CSSPropertyValue eValue) { … }
CFX_CSSTextAlign CFX_CSSStyleSelector::ToTextAlign(
CFX_CSSPropertyValue eValue) { … }
uint16_t CFX_CSSStyleSelector::ToFontWeight(CFX_CSSPropertyValue eValue) { … }
CFX_CSSFontStyle CFX_CSSStyleSelector::ToFontStyle(
CFX_CSSPropertyValue eValue) { … }
bool CFX_CSSStyleSelector::SetLengthWithPercent(
CFX_CSSLength& width,
CFX_CSSValue::PrimitiveType eType,
const RetainPtr<CFX_CSSValue>& pValue,
float fFontSize) { … }
float CFX_CSSStyleSelector::ToFontSize(CFX_CSSPropertyValue eValue,
float fCurFontSize) { … }
CFX_CSSVerticalAlign CFX_CSSStyleSelector::ToVerticalAlign(
CFX_CSSPropertyValue eValue) { … }
Mask<CFX_CSSTEXTDECORATION> CFX_CSSStyleSelector::ToTextDecoration(
const RetainPtr<CFX_CSSValueList>& pValue) { … }
CFX_CSSFontVariant CFX_CSSStyleSelector::ToFontVariant(
CFX_CSSPropertyValue eValue) { … }