Lines 2799-2814
Link Here
|
2799 |
// shifted due to floats??? |
2799 |
// shifted due to floats??? |
2800 |
return context.lineBox.getNextX(); |
2800 |
return context.lineBox.getNextX(); |
2801 |
} else { |
2801 |
} else { |
|
|
2802 |
if (boxType == BoxType.FIXED) { |
2803 |
// XXX #99918 For the fixed it is positioned against the viewport, |
2804 |
// so the 0 in current impl doesn't work, |
2805 |
return getStaticLeftForFixed(); |
2806 |
} |
2807 |
|
2802 |
// Block boxes are placed exactly at the containing block |
2808 |
// Block boxes are placed exactly at the containing block |
2803 |
// boundary so there's no distance |
2809 |
// boundary so there's no distance |
2804 |
return 0; |
2810 |
return 0; |
2805 |
} |
2811 |
} |
2806 |
} |
2812 |
} |
|
|
2813 |
|
2814 |
/** XXX Very hacky way, the parent boxes are not fully initialized yet. */ |
2815 |
private int getStaticLeftForFixed() { |
2816 |
CssBox positionBox = getParent(); |
2817 |
int staticLeft = 0; |
2818 |
while (positionBox != null && positionBox != getPositionedBy()) { |
2819 |
int leftIncrement = positionBox.left; |
2820 |
if (leftIncrement != AUTO && leftIncrement != UNINITIALIZED) { |
2821 |
staticLeft += leftIncrement; |
2822 |
} |
2823 |
positionBox = positionBox.getPositionedBy(); |
2824 |
} |
2825 |
return staticLeft; |
2826 |
} |
2807 |
|
2827 |
|
2808 |
/** Compute position of the current linebox - even if one hasn't |
2828 |
/** Compute position of the current linebox - even if one hasn't |
2809 |
* been started yet. |
2829 |
* been started yet. |
2810 |
*/ |
2830 |
*/ |
2811 |
private int getLineBoxY(FormatContext context) { |
2831 |
private int getStaticLineBoxY(FormatContext context) { |
2812 |
int py; |
2832 |
int py; |
2813 |
|
2833 |
|
2814 |
if (context.lineBox != null) { |
2834 |
if (context.lineBox != null) { |
Lines 3065-3071
Link Here
|
3065 |
* See also section 10.3.7 and the getStaticLeft() method. |
3085 |
* See also section 10.3.7 and the getStaticLeft() method. |
3066 |
*/ |
3086 |
*/ |
3067 |
private int getStaticTop(FormatContext context) { |
3087 |
private int getStaticTop(FormatContext context) { |
3068 |
return getLineBoxY(context); |
3088 |
// if (boxType == BoxType.FIXED) { |
|
|
3089 |
// // XXX #99918 For the fixed it is positioned against the viewport, |
3090 |
// // so the 0 in current impl doesn't work, |
3091 |
// return getStaticTopForFixed(); |
3092 |
// } else { |
3093 |
return getStaticLineBoxY(context); |
3094 |
// } |
3095 |
} |
3096 |
|
3097 |
/** XXX Very hacky way, the parent boxes are not fully initialized yet. */ |
3098 |
private int getStaticTopForFixed() { |
3099 |
CssBox positionBox = getParent(); |
3100 |
int staticTop = 0; |
3101 |
while (positionBox != null && positionBox != getPositionedBy()) { |
3102 |
int topIncrement = positionBox.top; |
3103 |
if (topIncrement != AUTO && topIncrement != UNINITIALIZED) { |
3104 |
staticTop += topIncrement; |
3105 |
} |
3106 |
positionBox = positionBox.getPositionedBy(); |
3107 |
} |
3108 |
return staticTop; |
3069 |
} |
3109 |
} |
3070 |
|
3110 |
|
3071 |
protected int shrinkToFit(int availableWidth, FormatContext context) { |
3111 |
protected int shrinkToFit(int availableWidth, FormatContext context) { |