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

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: review comments 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 4d3bae11dc22da0efb848f2c39ba49160f8fa334..2988fc9c7a6e8cb0eb355cd11f9b3227a18feec3 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();
}
@@ -1350,6 +1351,7 @@ void Element::attach(const AttachContext& context)
ContainerNode::attach(context);
createPseudoElementIfNeeded(AFTER);
+ createPseudoElementIfNeeded(BACKDROP);
if (hasRareData()) {
ElementRareData* data = elementRareData();
@@ -2409,7 +2411,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