Added check for unconstrained width/height of the containing block when
computing 'offsets' git-svn-id: svn://10.0.0.236/trunk@18413 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
e2ce091433
commit
94c5f449dd
@ -248,6 +248,17 @@ nsHTMLReflowState::ComputeRelativeOffsets(const nsHTMLReflowState* cbrs,
|
||||
PRBool leftIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetLeftUnit();
|
||||
PRBool rightIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetRightUnit();
|
||||
|
||||
// Check for percentage based values and an unconstrained containing
|
||||
// block width. Treat them like 'auto'
|
||||
if (NS_UNCONSTRAINEDSIZE == cbrs->computedWidth) {
|
||||
if (eStyleUnit_Percent == aPosition->mOffset.GetLeftUnit()) {
|
||||
leftIsAuto = PR_TRUE;
|
||||
}
|
||||
if (eStyleUnit_Percent == aPosition->mOffset.GetRightUnit()) {
|
||||
rightIsAuto = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// If neither 'left' not 'right' are auto, then we're over-constrained and
|
||||
// we ignore one of them
|
||||
if (!leftIsAuto && !rightIsAuto) {
|
||||
@ -301,6 +312,17 @@ nsHTMLReflowState::ComputeRelativeOffsets(const nsHTMLReflowState* cbrs,
|
||||
PRBool topIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetTopUnit();
|
||||
PRBool bottomIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetBottomUnit();
|
||||
|
||||
// Check for percentage based values and a containing block height that
|
||||
// depends on the content height. Treat them like 'auto'
|
||||
if (NS_AUTOHEIGHT == cbrs->computedHeight) {
|
||||
if (eStyleUnit_Percent == aPosition->mOffset.GetTopUnit()) {
|
||||
topIsAuto = PR_TRUE;
|
||||
}
|
||||
if (eStyleUnit_Percent == aPosition->mOffset.GetBottomUnit()) {
|
||||
bottomIsAuto = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// If neither is 'auto', 'bottom' is ignored
|
||||
if (!topIsAuto && !bottomIsAuto) {
|
||||
bottomIsAuto = PR_TRUE;
|
||||
|
||||
@ -248,6 +248,17 @@ nsHTMLReflowState::ComputeRelativeOffsets(const nsHTMLReflowState* cbrs,
|
||||
PRBool leftIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetLeftUnit();
|
||||
PRBool rightIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetRightUnit();
|
||||
|
||||
// Check for percentage based values and an unconstrained containing
|
||||
// block width. Treat them like 'auto'
|
||||
if (NS_UNCONSTRAINEDSIZE == cbrs->computedWidth) {
|
||||
if (eStyleUnit_Percent == aPosition->mOffset.GetLeftUnit()) {
|
||||
leftIsAuto = PR_TRUE;
|
||||
}
|
||||
if (eStyleUnit_Percent == aPosition->mOffset.GetRightUnit()) {
|
||||
rightIsAuto = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// If neither 'left' not 'right' are auto, then we're over-constrained and
|
||||
// we ignore one of them
|
||||
if (!leftIsAuto && !rightIsAuto) {
|
||||
@ -301,6 +312,17 @@ nsHTMLReflowState::ComputeRelativeOffsets(const nsHTMLReflowState* cbrs,
|
||||
PRBool topIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetTopUnit();
|
||||
PRBool bottomIsAuto = eStyleUnit_Auto == aPosition->mOffset.GetBottomUnit();
|
||||
|
||||
// Check for percentage based values and a containing block height that
|
||||
// depends on the content height. Treat them like 'auto'
|
||||
if (NS_AUTOHEIGHT == cbrs->computedHeight) {
|
||||
if (eStyleUnit_Percent == aPosition->mOffset.GetTopUnit()) {
|
||||
topIsAuto = PR_TRUE;
|
||||
}
|
||||
if (eStyleUnit_Percent == aPosition->mOffset.GetBottomUnit()) {
|
||||
bottomIsAuto = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// If neither is 'auto', 'bottom' is ignored
|
||||
if (!topIsAuto && !bottomIsAuto) {
|
||||
bottomIsAuto = PR_TRUE;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user