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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.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/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index f9660903f4b0737c6183822d5baf5c0f4d9d1f0c..024e8e5b61fe699460dc69e9bf6d9ff93e783566 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -35,6 +35,7 @@
#include "core/css/resolver/StyleResolver.h"
#include "core/dom/AXObjectCache.h"
#include "core/dom/ElementTraversal.h"
+#include "core/dom/PseudoElement.h"
#include "core/dom/StyleChangeReason.h"
#include "core/dom/StyleEngine.h"
#include "core/dom/shadow/ShadowRoot.h"
@@ -1580,6 +1581,11 @@ void LayoutObject::setPseudoStyle(PassRefPtr<ComputedStyle> pseudoStyle) {
setStyle(std::move(pseudoStyle));
}
+bool LayoutObject::isPseudoElementGeneratedContentFor(
+ const PseudoElement& pseudo) const {
+ return isAnonymous() && m_node.get() == &pseudo;
+}
+
void LayoutObject::firstLineStyleDidChange(const ComputedStyle& oldStyle,
const ComputedStyle& newStyle) {
StyleDifference diff = oldStyle.visualInvalidationDiff(newStyle);
@@ -3072,6 +3078,9 @@ ComputedStyle* LayoutObject::cachedFirstLineStyle() const {
ComputedStyle* LayoutObject::getCachedPseudoStyle(
PseudoId pseudo,
const ComputedStyle* parentStyle) const {
rune 2017/03/13 10:29:50 So, longer term, we'd remove this method as well,
emilio 2017/03/13 13:28:31 Yes, I think that'd be saner.
+ DCHECK_NE(pseudo, PseudoIdBefore);
+ DCHECK_NE(pseudo, PseudoIdAfter);
+
if (pseudo < FirstInternalPseudoId && !style()->hasPseudoStyle(pseudo))
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698