summaryrefslogtreecommitdiff
path: root/xfa/fde/css/cfde_cssstyleselector.h
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2017-02-02 13:56:25 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-02-02 22:18:38 +0000
commit44b297bb2c948ee4fb1e67301f31e4e7f70e48d7 (patch)
tree86b4201fea5ed4a47bda5c721a8446211cc75486 /xfa/fde/css/cfde_cssstyleselector.h
parent4bd0d99c11102514fb43328b67b7674165888619 (diff)
downloadpdfium-44b297bb2c948ee4fb1e67301f31e4e7f70e48d7.tar.xz
Clean up CSS code to match styles.chromium/3001
Simplify the code to what we support, remove unnecessary classes. Change-Id: I7af79a4720e0c95c609f163ebb86cf67d643add1 Reviewed-on: https://pdfium-review.googlesource.com/2430 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fde/css/cfde_cssstyleselector.h')
-rw-r--r--xfa/fde/css/cfde_cssstyleselector.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/xfa/fde/css/cfde_cssstyleselector.h b/xfa/fde/css/cfde_cssstyleselector.h
index 15bce93334..b4eaa685ae 100644
--- a/xfa/fde/css/cfde_cssstyleselector.h
+++ b/xfa/fde/css/cfde_cssstyleselector.h
@@ -15,45 +15,44 @@
#include "xfa/fde/css/cfde_cssrulecollection.h"
#include "xfa/fde/css/fde_css.h"
-class CFDE_CSSAccelerator;
class CFDE_CSSComputedStyle;
class CFDE_CSSCustomProperty;
class CFDE_CSSDeclaration;
class CFDE_CSSPropertyHolder;
class CFDE_CSSSelector;
class CFDE_CSSStyleSheet;
-class CFDE_CSSTagCache;
class CFDE_CSSValue;
class CFDE_CSSValueList;
class CFGAS_FontMgr;
-class CXFA_CSSTagProvider;
class CFDE_CSSStyleSelector {
public:
explicit CFDE_CSSStyleSelector(CFGAS_FontMgr* pFontMgr);
~CFDE_CSSStyleSelector();
- CFDE_CSSAccelerator* InitAccelerator();
-
void SetDefFontSize(FX_FLOAT fFontSize);
void SetUAStyleSheet(std::unique_ptr<CFDE_CSSStyleSheet> pSheet);
void UpdateStyleIndex();
CFX_RetainPtr<CFDE_CSSComputedStyle> CreateComputedStyle(
CFDE_CSSComputedStyle* pParentStyle);
- void ComputeStyle(CXFA_CSSTagProvider* pTag,
- const std::vector<const CFDE_CSSDeclaration*>& declArray,
+
+ // Note, the dest style has to be an out param because the CXFA_TextParser
+ // adds non-inherited data from the parent style. Attempting to copy
+ // internally will fail as you'll lose the non-inherited data.
+ void ComputeStyle(const std::vector<const CFDE_CSSDeclaration*>& declArray,
+ const CFX_WideString& styleString,
+ const CFX_WideString& alignString,
CFDE_CSSComputedStyle* pDestStyle);
std::vector<const CFDE_CSSDeclaration*> MatchDeclarations(
- CXFA_CSSTagProvider* pTag);
+ const CFX_WideString& tagname);
private:
- bool MatchSelector(CFDE_CSSTagCache* pCache, CFDE_CSSSelector* pSel);
+ bool MatchSelector(const CFX_WideString& tagname, CFDE_CSSSelector* pSel);
void AppendInlineStyle(CFDE_CSSDeclaration* pDecl,
- const FX_WCHAR* psz,
- int32_t iLen);
+ const CFX_WideString& style);
void ApplyDeclarations(
const std::vector<const CFDE_CSSDeclaration*>& declArray,
const CFDE_CSSDeclaration* extraDecl,
@@ -83,7 +82,6 @@ class CFDE_CSSStyleSelector {
FX_FLOAT m_fDefFontSize;
std::unique_ptr<CFDE_CSSStyleSheet> m_UAStyles;
CFDE_CSSRuleCollection m_UARules;
- std::unique_ptr<CFDE_CSSAccelerator> m_pAccelerator;
};
#endif // XFA_FDE_CSS_CFDE_CSSSTYLESELECTOR_H_