7#include "core/fxcrt/css/cfx_cssstylesheet.h"
11#include "core/fxcrt/css/cfx_cssdata.h"
12#include "core/fxcrt/css/cfx_cssdeclaration.h"
13#include "core/fxcrt/css/cfx_cssstylerule.h"
14#include "core/fxcrt/fx_codepage.h"
21 return m_RuleArray.size();
25 return m_RuleArray[index].get();
34 eStatus = LoadStyleRule(pSyntax.get());
44 std::vector<std::unique_ptr<CFX_CSSSelector>> selectors;
46 int32_t iValueLen = 0;
52 WideStringView strValue = pSyntax->GetCurrentString();
53 auto pSelector = CFX_CSSSelector::FromString(strValue);
55 selectors.push_back(
std::move(pSelector));
59 WideStringView strValue = pSyntax->GetCurrentString();
62 wsName
= WideString(strValue);
66 if (property || iValueLen > 0) {
67 WideStringView strValue = pSyntax->GetCurrentString();
69 if (!strValue.IsEmpty()) {
71 decl->AddProperty(property, strValue);
80 if (!pStyleRule && !selectors.empty()) {
82 pStyleRule = rule.get();
83 pStyleRule->SetSelector(&selectors);
84 m_RuleArray.push_back(std::move(rule));
93 m_RuleArray.pop_back();
static const Property * GetPropertyByName(WideStringView name)
void AddProperty(const WideString &prop, const WideString &value)
CFX_CSSDeclaration * GetDeclaration()
size_t CountRules() const
bool LoadBuffer(WideStringView buffer)
CFX_CSSStyleRule * GetRule(size_t index) const
WideString & operator=(WideString &&that) noexcept