summaryrefslogtreecommitdiff
path: root/xfa/fde/css/cfde_cssselector.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-01-23 15:38:28 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-24 14:28:24 +0000
commit1339133720c3b8bce77e970b479ec179160f30b5 (patch)
tree5927042eab27eaa4a96cf4276dec54d3e8a44a23 /xfa/fde/css/cfde_cssselector.cpp
parent3d328767f9c0c04b62173aac03c35aab3fb87ffe (diff)
downloadpdfium-1339133720c3b8bce77e970b479ec179160f30b5.tar.xz
Remove ID, Class and Universal selector code
The UA style defined in CXFA_TextParser does not specify any ID, Class or Universal selectors. Remove related code. Change-Id: I9f2d760ee86f309a9cfa8a0f1f3e3dd7a15ef4c8 Reviewed-on: https://pdfium-review.googlesource.com/2295 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fde/css/cfde_cssselector.cpp')
-rw-r--r--xfa/fde/css/cfde_cssselector.cpp29
1 files changed, 1 insertions, 28 deletions
diff --git a/xfa/fde/css/cfde_cssselector.cpp b/xfa/fde/css/cfde_cssselector.cpp
index bd800c0fa5..718cb46415 100644
--- a/xfa/fde/css/cfde_cssselector.cpp
+++ b/xfa/fde/css/cfde_cssselector.cpp
@@ -78,34 +78,7 @@ std::unique_ptr<CFDE_CSSSelector> CFDE_CSSSelector::FromString(
for (psz = pStart; psz < pEnd;) {
FX_WCHAR wch = *psz;
- if (wch == '.' || wch == '#') {
- if (psz == pStart || psz[-1] == ' ') {
- auto p = pdfium::MakeUnique<CFDE_CSSSelector>(
- FDE_CSSSelectorType::Element, L"*", 1, true);
-
- if (pFirst) {
- pFirst->SetType(FDE_CSSSelectorType::Descendant);
- p->SetNext(std::move(pFirst));
- }
- pFirst = std::move(p);
- pLast = pFirst.get();
- }
- ASSERT(pLast);
-
- int32_t iNameLen = GetCSSNameLen(++psz, pEnd);
- if (iNameLen == 0)
- return nullptr;
-
- FDE_CSSSelectorType eType =
- wch == '.' ? FDE_CSSSelectorType::Class : FDE_CSSSelectorType::ID;
- auto p =
- pdfium::MakeUnique<CFDE_CSSSelector>(eType, psz, iNameLen, false);
-
- p->SetNext(pLast->ReleaseNextSelector());
- pLast->SetNext(std::move(p));
- pLast = pLast->GetNextSelector();
- psz += iNameLen;
- } else if (IsCSSChar(wch) || wch == '*') {
+ if (IsCSSChar(wch) || wch == '*') {
int32_t iNameLen = wch == '*' ? 1 : GetCSSNameLen(psz, pEnd);
if (iNameLen == 0)
return nullptr;