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

Unified Diff: Source/core/dom/Element.cpp

Issue 17654008: Implement the ::backdrop pseudo-element for modal <dialog>. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix failing tests Created 7 years, 6 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: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 8df5e79ab407fa858be4c1cfe83b049e1602ea14..ba67e72f28ad1ac96924ae89e485ff3bc1dcf49d 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -205,6 +205,7 @@ Element::~Element()
ElementRareData* data = elementRareData();
data->setPseudoElement(BEFORE, 0);
data->setPseudoElement(AFTER, 0);
+ data->setPseudoElement(BACKDROP, 0);
data->clearShadow();
}
@@ -1343,6 +1344,7 @@ void Element::attach(const AttachContext& context)
ContainerNode::attach(context);
createPseudoElementIfNeeded(AFTER);
+ createPseudoElementIfNeeded(BACKDROP);
if (hasRareData()) {
ElementRareData* data = elementRareData();
@@ -2402,7 +2404,10 @@ void Element::updatePseudoElement(PseudoId pseudoId, StyleChange change)
void Element::createPseudoElementIfNeeded(PseudoId pseudoId)
{
- if (!document()->styleSheetCollection()->usesBeforeAfterRules())
+ if ((pseudoId == BEFORE || pseudoId == AFTER) && !document()->styleSheetCollection()->usesBeforeAfterRules())
+ return;
+
+ if (pseudoId == BACKDROP && !isInTopLayer())
return;
if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedPseudoStyle(pseudoId)))

Powered by Google App Engine
This is Rietveld 408576698