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

Unified Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 16529003: Simplify 'position' adjustment of top layer elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | « LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static-expected.txt ('k') | no next file » | 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 64d994cb7cc6c6ae2b3d07dbfc7e497f9fd7304b..4b8b2814c320159aae0f59eaaf0b56fbb67d1736 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -1543,6 +1543,10 @@ void StyleResolver::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty
if (e && e->hasTagName(legendTag))
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);
+
// 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))
style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloating(), !document()->inQuirksMode()));
@@ -1577,12 +1581,6 @@ void StyleResolver::adjustRenderStyle(RenderStyle* style, RenderStyle* parentSty
style->setFloating(NoFloat);
style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloating(), !document()->inQuirksMode()));
}
-
- // 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);
- style->setDisplay(BLOCK);
- }
}
// Make sure our z-index value is only applied if the object is positioned.
« no previous file with comments | « LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698