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

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

Issue 2727853002: [css-display] Support display: contents pseudo-elements.
Patch Set: Add missing nullcheck (whoops). 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/LayoutTextFragment.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp b/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp
index 72d1e4fd430d6e00a1399086abdd06f47fbbcd6a..261e6a26cc839cc3f14de5a044559b95e980f441 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp
@@ -26,6 +26,7 @@
#include "core/dom/PseudoElement.h"
#include "core/dom/StyleChangeReason.h"
#include "core/dom/Text.h"
+#include "core/frame/FrameView.h"
#include "core/layout/HitTestResult.h"
namespace blink {
@@ -55,6 +56,22 @@ LayoutTextFragment::~LayoutTextFragment() {
ASSERT(!m_firstLetterPseudoElement);
}
+LayoutTextFragment* LayoutTextFragment::createAnonymous(PseudoElement& pseudo,
+ StringImpl* str,
+ unsigned start,
+ unsigned length) {
+ LayoutTextFragment* text =
+ new LayoutTextFragment(nullptr, str, start, length);
+ text->setPseudoForAnonymous(pseudo);
+ pseudo.document().view()->incrementVisuallyNonEmptyCharacterCount(length);
+ return text;
+}
+
+LayoutTextFragment* LayoutTextFragment::createAnonymous(PseudoElement& pseudo,
+ StringImpl* str) {
+ return createAnonymous(pseudo, str, 0, str ? str->length() : 0);
+}
+
void LayoutTextFragment::willBeDestroyed() {
if (m_isRemainingTextLayoutObject && m_firstLetterPseudoElement)
m_firstLetterPseudoElement->setRemainingTextLayoutObject(nullptr);

Powered by Google App Engine
This is Rietveld 408576698