summaryrefslogtreecommitdiff
path: root/xfa/fde/css/cfde_cssselector.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-01-26 10:02:06 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-26 15:21:52 +0000
commit98909bf9f458614abc1bb7f4df34a319a1d5ce3f (patch)
tree432f597117086be5dfaee02576109edd539e54c7 /xfa/fde/css/cfde_cssselector.cpp
parent35ee5bb4a2e51fd42f07c23a4008bfb97e390b25 (diff)
downloadpdfium-98909bf9f458614abc1bb7f4df34a319a1d5ce3f.tar.xz
Add CSS parser tests
This CL adds more unit tests to the css parser and removes some unused code. Change-Id: If233040e19c7a79a907a3215877e042ac388d61b Reviewed-on: https://pdfium-review.googlesource.com/2412 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.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/xfa/fde/css/cfde_cssselector.cpp b/xfa/fde/css/cfde_cssselector.cpp
index 718cb46415..6d181ac325 100644
--- a/xfa/fde/css/cfde_cssselector.cpp
+++ b/xfa/fde/css/cfde_cssselector.cpp
@@ -53,10 +53,6 @@ CFDE_CSSSelector* CFDE_CSSSelector::GetNextSelector() const {
return m_pNext.get();
}
-std::unique_ptr<CFDE_CSSSelector> CFDE_CSSSelector::ReleaseNextSelector() {
- return std::move(m_pNext);
-}
-
std::unique_ptr<CFDE_CSSSelector> CFDE_CSSSelector::FromString(
const FX_WCHAR* psz,
int32_t iLen) {
@@ -74,15 +70,10 @@ std::unique_ptr<CFDE_CSSSelector> CFDE_CSSSelector::FromString(
}
std::unique_ptr<CFDE_CSSSelector> pFirst = nullptr;
- CFDE_CSSSelector* pLast = nullptr;
-
for (psz = pStart; psz < pEnd;) {
FX_WCHAR wch = *psz;
if (IsCSSChar(wch) || wch == '*') {
int32_t iNameLen = wch == '*' ? 1 : GetCSSNameLen(psz, pEnd);
- if (iNameLen == 0)
- return nullptr;
-
auto p = pdfium::MakeUnique<CFDE_CSSSelector>(
FDE_CSSSelectorType::Element, psz, iNameLen, true);
if (pFirst) {
@@ -90,7 +81,6 @@ std::unique_ptr<CFDE_CSSSelector> CFDE_CSSSelector::FromString(
p->SetNext(std::move(pFirst));
}
pFirst = std::move(p);
- pLast = pFirst.get();
psz += iNameLen;
} else if (wch == ' ') {
psz++;