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

Unified Diff: third_party/WebKit/Source/core/dom/PseudoElement.cpp

Issue 2202493002: NOT FOR REVIEW: Fullscreen WIP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 1 month 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/dom/PseudoElement.cpp
diff --git a/third_party/WebKit/Source/core/dom/PseudoElement.cpp b/third_party/WebKit/Source/core/dom/PseudoElement.cpp
index d82156feae41c10d020e28babff95bf24fc0b828..01f30554d007c22e30d1417d75b30a729fd53755 100644
--- a/third_party/WebKit/Source/core/dom/PseudoElement.cpp
+++ b/third_party/WebKit/Source/core/dom/PseudoElement.cpp
@@ -29,6 +29,7 @@
#include "core/dom/FirstLetterPseudoElement.h"
#include "core/frame/UseCounter.h"
#include "core/inspector/InspectorInstrumentation.h"
+#include "core/layout/GeneratedChildren.h"
#include "core/layout/LayoutObject.h"
#include "core/layout/LayoutQuote.h"
#include "core/style/ContentData.h"
@@ -125,6 +126,13 @@ void PseudoElement::attachLayoutTree(const AttachContext& context) {
if (!layoutObject)
return;
+ // This is to ensure that bypassing the canHaveGeneratedChildren check in
+ // StyleResolver::createPseudoElementIfNeeded does not result in the
+ // backdrop pseudo element's layout object becoming the child of a layout
+ // object that doesn't allow children.
+ DCHECK(layoutObject->parent());
+ DCHECK(canHaveGeneratedChildren(*layoutObject->parent()));
+
ComputedStyle& style = layoutObject->mutableStyleRef();
if (style.styleType() != PseudoIdBefore && style.styleType() != PseudoIdAfter)
return;

Powered by Google App Engine
This is Rietveld 408576698