summaryrefslogtreecommitdiff
path: root/xfa/fde/css/cfde_cssaccelerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fde/css/cfde_cssaccelerator.cpp')
-rw-r--r--xfa/fde/css/cfde_cssaccelerator.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/xfa/fde/css/cfde_cssaccelerator.cpp b/xfa/fde/css/cfde_cssaccelerator.cpp
new file mode 100644
index 0000000000..40fa13e058
--- /dev/null
+++ b/xfa/fde/css/cfde_cssaccelerator.cpp
@@ -0,0 +1,23 @@
+// Copyright 2017 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "xfa/fde/css/cfde_cssaccelerator.h"
+
+#include "third_party/base/ptr_util.h"
+
+CFDE_CSSAccelerator::CFDE_CSSAccelerator() {}
+
+CFDE_CSSAccelerator::~CFDE_CSSAccelerator() {}
+
+void CFDE_CSSAccelerator::OnEnterTag(CXFA_CSSTagProvider* pTag) {
+ stack_.push(pdfium::MakeUnique<CFDE_CSSTagCache>(top(), pTag));
+}
+
+void CFDE_CSSAccelerator::OnLeaveTag(CXFA_CSSTagProvider* pTag) {
+ ASSERT(!stack_.empty());
+ ASSERT(stack_.top()->GetTag() == pTag);
+ stack_.pop();
+}