diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-01-23 13:54:53 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-01-23 19:48:54 +0000 |
commit | 6414b273506f97012f82c8a32c020b483d5df31a (patch) | |
tree | f790a25f03e78fe084ee22cb16418d95deaf3dd3 /xfa/fxfa | |
parent | a0b2d23d1121202d3821291483943a47a3c9e32e (diff) | |
download | pdfium-6414b273506f97012f82c8a32c020b483d5df31a.tar.xz |
Cleanup CSS parsing
This Cl removes unused CSS parsing code. The only caller of
CFDE_CSSStyleSheet::LoadeBuffer is from CXFA_TextParser which provides a static
string. So, we know there are no Media rules, Import rules, FontFace rules or
Page rules in the input style. These rules are also not allowed in inline
styles. This CL removes the supporting code.
Change-Id: I3a559352b2dd0769c465cbd3da40d1db5f9577b0
Reviewed-on: https://pdfium-review.googlesource.com/2330
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa')
-rw-r--r-- | xfa/fxfa/app/cxfa_textparser.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/xfa/fxfa/app/cxfa_textparser.cpp b/xfa/fxfa/app/cxfa_textparser.cpp index 9920f6e723..703d11ec11 100644 --- a/xfa/fxfa/app/cxfa_textparser.cpp +++ b/xfa/fxfa/app/cxfa_textparser.cpp @@ -79,7 +79,7 @@ void CXFA_TextParser::InitCSSData(CXFA_TextProvider* pTextProvider) { if (!m_pUASheet) { m_pUASheet = LoadDefaultSheetStyle(); m_pSelector->SetStyleSheet(FDE_CSSStyleSheetGroup::UserAgent, m_pUASheet); - m_pSelector->UpdateStyleIndex(FDE_CSSMEDIATYPE_ALL); + m_pSelector->UpdateStyleIndex(); } } @@ -87,15 +87,16 @@ CFDE_CSSStyleSheet* CXFA_TextParser::LoadDefaultSheetStyle() { static const FX_WCHAR s_pStyle[] = L"html,body,ol,p,ul{display:block}" L"li{display:list-item}" - L"ol,ul{padding-left:33px}ol{list-style-type:decimal}ol,ul{margin-top:0;" - L"margin-bottom:0}ul,ol{margin:1.12em 0}" - L"a{color:#0000ff;text-decoration:underline}b{font-weight:bolder}i{font-" - L"style:italic}" - L"sup{vertical-align:+15em;font-size:.66em}sub{vertical-align:-15em;font-" - L"size:.66em}"; + L"ol,ul{padding-left:33px;margin:1.12em 0}" + L"ol{list-style-type:decimal}" + L"a{color:#0000ff;text-decoration:underline}" + L"b{font-weight:bolder}" + L"i{font-style:italic}" + L"sup{vertical-align:+15em;font-size:.66em}" + L"sub{vertical-align:-15em;font-size:.66em}"; CFDE_CSSStyleSheet* pStyleSheet = new CFDE_CSSStyleSheet(); - if (!pStyleSheet->LoadFromBuffer(s_pStyle, FXSYS_wcslen(s_pStyle))) { + if (!pStyleSheet->LoadBuffer(s_pStyle, FXSYS_wcslen(s_pStyle))) { pStyleSheet->Release(); pStyleSheet = nullptr; } |