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

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: 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/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 6b7e2e1d73d0f7bc42cbace38f311f3d8af8d2db..d87f45a20c47042df11345364da75b8eb878692c 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -1245,7 +1245,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()) {
Julien - ping for review 2013/06/27 22:49:00 It's weird to disallow style cascading for ::backd
falken 2013/06/28 08:06:52 The spec says ::backdrop "does not inherit from an
state.setStyle(RenderStyle::create());
state.style()->inheritFrom(m_state.parentStyle());
} else {
@@ -1494,8 +1494,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))

Powered by Google App Engine
This is Rietveld 408576698