Bug 1236828 part 3 - Allow setting position: absolute for top layer element. r?dbaron
MozReview-Commit-ID: 9BMGe88eq6g
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -5851,24 +5851,18 @@ nsRuleNode::ComputeDisplayData(void* aSt
SetDiscrete(*aRuleData->ValueForPosition(), display->mPosition, conditions,
SETDSC_ENUMERATED | SETDSC_UNSET_INITIAL,
parentDisplay->mPosition,
NS_STYLE_POSITION_STATIC, 0, 0, 0, 0);
// If an element is put in the top layer, while it is not absolutely
// positioned, the position value should be computed to 'absolute' per
// the Fullscreen API spec.
if (display->mTopLayer != NS_STYLE_TOP_LAYER_NONE &&
- // XXX We currently only support fixed top layer element. But per
- // spec it should check IsAbsolutelyPositionedStyle() instead.
- // This should be fixed as soon as we support <dialog> element
- // in bug 840640. We have to restrict it now because addons may
- // mess with UA-only styles and cause crashes. See bug 1230508.
- display->mPosition != NS_STYLE_POSITION_FIXED) {
- // XXX And we should set other values to absolute instead of fixed.
- display->mPosition = NS_STYLE_POSITION_FIXED;
+ !display->IsAbsolutelyPositionedStyle()) {
+ display->mPosition = NS_STYLE_POSITION_ABSOLUTE;
// We cannot cache this struct because otherwise it may be used as
// an aStartStruct for some other elements.
conditions.SetUncacheable();
}
// clear: enum, inherit, initial
SetDiscrete(*aRuleData->ValueForClear(), display->mBreakType, conditions,
SETDSC_ENUMERATED | SETDSC_UNSET_INITIAL,