Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutCounter.cpp

Issue 2754653002: Cleanup anonymous text objects that pass the document as a node. (Closed)
Patch Set: Cleanup anonymous text objects that pass the document as a node. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutCounter.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutCounter.cpp b/third_party/WebKit/Source/core/layout/LayoutCounter.cpp
index 55ee982b0f78eb24fdfaaa542acac778bd3ee22c..a37e1ca0d4a4062ad8f6c89f8ef4926eaf1d30b2 100644
--- a/third_party/WebKit/Source/core/layout/LayoutCounter.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutCounter.cpp
@@ -21,9 +21,11 @@
#include "core/layout/LayoutCounter.h"
+#include <memory>
#include "core/HTMLNames.h"
#include "core/dom/Element.h"
#include "core/dom/ElementTraversal.h"
+#include "core/dom/PseudoElement.h"
#include "core/html/HTMLOListElement.h"
#include "core/layout/CounterNode.h"
#include "core/layout/LayoutListItem.h"
@@ -32,7 +34,6 @@
#include "core/style/ComputedStyle.h"
#include "wtf/PtrUtil.h"
#include "wtf/StdLibExtras.h"
-#include <memory>
#ifndef NDEBUG
#include <stdio.h>
@@ -424,11 +425,13 @@ static CounterNode* makeCounterNodeIfNeeded(LayoutObject& object,
return newNode.get();
}
-LayoutCounter::LayoutCounter(Document* node, const CounterContent& counter)
- : LayoutText(node, StringImpl::empty),
+LayoutCounter::LayoutCounter(PseudoElement& pseudo,
+ const CounterContent& counter)
+ : LayoutText(nullptr, StringImpl::empty),
m_counter(counter),
m_counterNode(nullptr),
m_nextForSameCounter(nullptr) {
+ setDocumentForAnonymous(&pseudo.document());
view()->addLayoutCounter();
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutCounter.h ('k') | third_party/WebKit/Source/core/layout/LayoutImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698