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

Unified Diff: Source/core/css/resolver/StyleResolver.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
« no previous file with comments | « Source/core/css/CSSSelector.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 01daeb9f6769590ad0a17cdb7e5962f66a24cf63..2fd0d067d8435e4d79ce09754932eb72ff5c219e 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -1246,7 +1246,7 @@ PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* e, const P
state.initForStyleResolve(document(), e, parentStyle);
- if (m_state.parentStyle()) {
+ if (pseudoStyleRequest.pseudoId != BACKDROP && m_state.parentStyle()) { // The spec disallows inheritance for ::backdrop.
state.setStyle(RenderStyle::create());
state.style()->inheritFrom(m_state.parentStyle());
} else {
@@ -1495,8 +1495,10 @@ void StyleResolver::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty
style->setDisplay(BLOCK);
// Per the spec, position 'static' and 'relative' in the top layer compute to 'absolute'.
- if (e && e->isInTopLayer() && (style->position() == StaticPosition || style->position() == RelativePosition))
- style->setPosition(AbsolutePosition);
+ if ((e && e->isInTopLayer()) || style->styleType() == BACKDROP) {
+ if (style->position() == StaticPosition || style->position() == RelativePosition)
+ style->setPosition(AbsolutePosition);
+ }
// Absolute/fixed positioned elements, floating elements and the document element need block-like outside display.
if (style->hasOutOfFlowPosition() || style->isFloating() || (e && e->document()->documentElement() == e))
@@ -1551,7 +1553,7 @@ void StyleResolver::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty
|| style->hasBlendMode()
|| style->position() == StickyPosition
|| (style->position() == FixedPosition && e && e->document()->page() && e->document()->page()->settings()->fixedPositionCreatesStackingContext())
- || (e && e->isInTopLayer())
+ || ((e && e->isInTopLayer()) || style->styleType() == BACKDROP)
Julien - ping for review 2013/07/03 01:48:05 This is now repeated twice, which means a helper f
falken 2013/07/03 06:14:48 Done.
))
style->setZIndex(0);
« no previous file with comments | « Source/core/css/CSSSelector.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698