mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 09:19:28 +00:00
Fix computed style for percents for offset properties when the element doesn't have a frame. (Bug 585715) r=bzbarsky a2.0=blocking+
This commit is contained in:
parent
b4d36c5999
commit
c4f2785b8e
@ -3489,8 +3489,16 @@ nsComputedDOMStyle::GetOffsetWidthFor(mozilla::css::Side aSide,
|
||||
|
||||
AssertFlushedPendingReflows();
|
||||
|
||||
PRUint8 position = display->mPosition;
|
||||
if (!mOuterFrame) {
|
||||
// GetRelativeOffset and GetAbsoluteOffset don't handle elements
|
||||
// without frames in any sensible way. GetStaticOffset, however,
|
||||
// is perfect for that case.
|
||||
position = NS_STYLE_POSITION_STATIC;
|
||||
}
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
switch (display->mPosition) {
|
||||
switch (position) {
|
||||
case NS_STYLE_POSITION_STATIC:
|
||||
rv = GetStaticOffset(aSide, aValue);
|
||||
break;
|
||||
|
@ -56,13 +56,13 @@ is(getComp("three").bottom, "6px",
|
||||
is(getComp("three").left, "10px",
|
||||
"Incorrect computed left offset if specified in %")
|
||||
|
||||
is(getComp("four").top, "0px",
|
||||
is(getComp("four").top, "auto",
|
||||
"Incorrect undisplayed computed top offset if specified in %")
|
||||
is(getComp("four").right, "0px",
|
||||
is(getComp("four").right, "auto",
|
||||
"Incorrect undisplayed computed right offset if specified in %")
|
||||
is(getComp("four").bottom, "0px",
|
||||
is(getComp("four").bottom, "20%",
|
||||
"Incorrect undisplayed computed bottom offset if specified in %")
|
||||
is(getComp("four").left, "0px",
|
||||
is(getComp("four").left, "10%",
|
||||
"Incorrect undisplayed computed left offset if specified in %")
|
||||
|
||||
</script>
|
||||
|
@ -69,12 +69,6 @@ var gBadComputedNoFrame = {
|
||||
"padding-left": [ "0%" ],
|
||||
"padding-right": [ "0%" ],
|
||||
"padding-top": [ "0%" ],
|
||||
|
||||
// FIXME: file a bug
|
||||
"top": [ "12%" ],
|
||||
"right": [ "12%" ],
|
||||
"bottom": [ "12%" ],
|
||||
"left": [ "12%" ],
|
||||
};
|
||||
|
||||
function xfail_value(property, value, is_initial, has_frame) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user