blob: 719baede26f5f70bffa1d87ce4be87e4f0934378 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
/* derived from PR optimization/11440 */
extern void abort (void);
extern void exit (int);
typedef _Bool bool;
const bool false = 0;
const bool true = 1;
enum EPosition
{
STATIC, RELATIVE, ABSOLUTE, FIXED
};
typedef enum EPosition EPosition;
enum EFloat
{
FNONE = 0, FLEFT, FRIGHT
};
typedef enum EFloat EFloat;
struct RenderBox
{
int unused[6];
short m_verticalPosition;
bool m_layouted : 1;
bool m_unused : 1;
bool m_minMaxKnown : 1;
bool m_floating : 1;
bool m_positioned : 1;
bool m_overhangingContents : 1;
bool m_relPositioned : 1;
bool m_paintSpecial : 1;
bool m_isAnonymous : 1;
bool m_recalcMinMax : 1;
bool m_isText : 1;
bool m_inline : 1;
bool m_replaced : 1;
bool m_mouseInside : 1;
bool m_hasFirstLine : 1;
bool m_isSelectionBorder : 1;
bool (*isTableCell) (struct RenderBox *this);
};
typedef struct RenderBox RenderBox;
struct RenderStyle
{
struct NonInheritedFlags
{
union
{
struct
{
unsigned int _display : 4;
unsigned int _bg_repeat : 2;
bool _bg_attachment : 1;
unsigned int _overflow : 4 ;
unsigned int _vertical_align : 4;
unsigned int _clear : 2;
EPosition _position : 2;
EFloat _floating : 2;
unsigned int _table_layout : 1;
bool _flowAroundFloats :1;
unsigned int _styleType : 3;
bool _hasHover : 1;
bool _hasActive : 1;
bool _clipSpecified : 1;
unsigned int _unicodeBidi : 2;
int _unused : 1;
} f;
int _niflags;
};
} noninherited_flags;
};
typedef struct RenderStyle RenderStyle;
extern void RenderObject_setStyle(RenderBox *this, RenderStyle *_style);
extern void removeFromSpecialObjects(RenderBox *this);
void RenderBox_setStyle(RenderBox *thisin, RenderStyle *_style)
{
RenderBox *this = thisin;
bool oldpos, tmp;
EPosition tmppo;
tmp = this->m_positioned;
oldpos = tmp;
RenderObject_setStyle(this, _style);
tmppo = _style->noninherited_flags.f._position;
switch(tmppo)
{
case ABSOLUTE:
case FIXED:
{
bool ltrue = true;
this->m_positioned = ltrue;
break;
}
default:
{
EFloat tmpf;
EPosition tmpp;
if (oldpos)
{
bool ltrue = true;
this->m_positioned = ltrue;
removeFromSpecialObjects(this);
}
{
bool lfalse = false;
this->m_positioned = lfalse;
}
tmpf = _style->noninherited_flags.f._floating;
if(!this->isTableCell (this) && !(tmpf == FNONE))
{
bool ltrue = true;
this->m_floating = ltrue;
}
else
{
tmpp = _style->noninherited_flags.f._position;
if (tmpp == RELATIVE)
{
bool ltrue = true;
this->m_relPositioned = ltrue;
}
}
}
}
}
RenderBox g_this;
RenderStyle g__style;
void RenderObject_setStyle(RenderBox *this, RenderStyle *_style)
{
(void) this;
(void) _style;
}
void removeFromSpecialObjects(RenderBox *this)
{
(void) this;
}
bool RenderBox_isTableCell (RenderBox *this)
{
(void) this;
return false;
}
int main (void)
{
g_this.m_relPositioned = false;
g_this.m_positioned = false;
g_this.m_floating = false;
g_this.isTableCell = RenderBox_isTableCell;
g__style.noninherited_flags.f._position = FIXED;
g__style.noninherited_flags.f._floating = FNONE;
RenderBox_setStyle (&g_this, &g__style);
if (g_this.m_positioned != true)
abort ();
if (g_this.m_relPositioned != false)
abort ();
if (g_this.m_floating != false)
abort ();
exit (0);
}
|