Commit 37c111e
committed
Handle padding and margins correctly for flex and grid in all writing modes
https://bugs.webkit.org/show_bug.cgi?id=218579
rdar://71046552
Reviewed by Alan Baradlay.
Encodes tracking of in-flow scrollable content edges into RenderOverflow
as rectangles, and more cleanly tracks margin-box overflow of items by
handling it as an option within the existing addOverflow* methods.
Using rectangles means we can easily handle all the writing modes correctly,
thus many tests are fixed. \^_^/
* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/anchor-scroll-position-try-014-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/negative-overflow-002-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/negative-overflow-003-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/negative-overflow-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/scrollable-overflow-height-with-flex-item-margin-inline-end-rtl-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/scrollable-overflow-zero-one-axis-expected.txt:
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-flexbox/negative-overflow-002-expected.txt: Removed.
Pass more tests.
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-overflow-002-expected.txt:
Rebaseline. (The test needs to be fixed upstream; the behavior is correct.)
* Source/WebCore/platform/graphics/LayoutRect.h:
(WebCore::LayoutRect::floorSize):
Add utility method.
* Source/WebCore/rendering/LegacyInlineFlowBox.cpp:
(WebCore::LegacyInlineFlowBox::setVisualOverflow):
Update call to RenderOverflow constructor.
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeOverflow):
Remove tangled up writing mode handling with simpler logic using stored
content area rectangle. This is now more correct.
(WebCore::RenderBlock::clearLayoutOverflow):
Update to also clear the content area rectangle.
(WebCore::RenderBlock::simplifiedLayout):
* Source/WebCore/rendering/RenderBlock.h:
(WebCore::RenderBlock::computeOverflow):
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::computeOverflow):
* Source/WebCore/rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::computeOverflow):
Update to retrieve / track / pass content area rectangle instead of single coord.
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::addOverflowWithRendererOffset):
Remove code that has super tangled up writing mode handling and embeds
subclass logic into this superclass, and replace with a generic option
to track margin areas.
(WebCore::RenderBox::ensureOverflow):
Update call to RenderOverflow constructor.
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderBoxInlines.h:
(WebCore::RenderBox::flippedContentBoxRect const):
Add new convenience method to retrieve flipped contentBoxRect().
Add more options to ComputeOverflowOptions for addOverflow*
* Source/WebCore/rendering/RenderBoxFragmentInfo.h:
(WebCore::RenderBoxFragmentInfo::createOverflow):
Update call to RenderOverflow constructor.
* Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
(WebCore::RenderDeprecatedFlexibleBox::layoutSingleClampedFlexItem):
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):
Update computeOverflow call to use new API and margin tracking option.
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutGrid):
(WebCore::RenderGrid::layoutMasonry):
Update computeOverflow call to use new API and margin tracking option.
(WebCore::RenderGrid::contentOverflowRect const):
(WebCore::RenderGrid::computeOverflow): Deleted.
* Source/WebCore/rendering/RenderGrid.h:
Add method to calculate the content area rectangle to pass to computeOverflow
and remove now unneeded computeOverflow method.
* Source/WebCore/rendering/RenderOverflow.h:
(WebCore::RenderOverflow::RenderOverflow):
(WebCore::RenderOverflow::contentArea const):
(WebCore::RenderOverflow::addContentOverflow):
(WebCore::RenderOverflow::setContentArea):
(WebCore::RenderOverflow::move):
(WebCore::RenderOverflow::layoutClientAfterEdge const): Deleted.
(WebCore::RenderOverflow::setLayoutClientAfterEdge): Deleted.
Set up tracking for content area rectangle.
* Source/WebCore/rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):
* Source/WebCore/rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):
* Source/WebCore/rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::computeOverflow):
* Source/WebCore/rendering/svg/RenderSVGBlock.h:
Update to new computeOverflow API.
Canonical link: https://commits.webkit.org/301814@main1 parent fc7a433 commit 37c111e
File tree
29 files changed
+193
-652
lines changed- LayoutTests
- imported/w3c/web-platform-tests/css
- css-anchor-position
- css-flexbox
- css-grid/alignment
- css-overflow
- platform/ios/imported/w3c/web-platform-tests/css/css-flexbox
- Source/WebCore
- platform/graphics
- rendering
- svg
29 files changed
+193
-652
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5056 | 5056 | | |
5057 | 5057 | | |
5058 | 5058 | | |
5059 | | - | |
5060 | | - | |
5061 | 5059 | | |
5062 | | - | |
5063 | 5060 | | |
5064 | 5061 | | |
5065 | 5062 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
Lines changed: 30 additions & 90 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
221 | | - | |
222 | | - | |
| 220 | + | |
223 | 221 | | |
224 | 222 | | |
225 | | - | |
226 | | - | |
227 | | - | |
| 223 | + | |
228 | 224 | | |
229 | 225 | | |
230 | 226 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
240 | 230 | | |
241 | 231 | | |
242 | | - | |
243 | | - | |
244 | | - | |
| 232 | + | |
245 | 233 | | |
246 | 234 | | |
247 | | - | |
248 | | - | |
249 | | - | |
| 235 | + | |
250 | 236 | | |
251 | 237 | | |
252 | 238 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
262 | 242 | | |
263 | 243 | | |
264 | | - | |
265 | | - | |
266 | | - | |
| 244 | + | |
267 | 245 | | |
268 | 246 | | |
269 | | - | |
270 | | - | |
271 | | - | |
| 247 | + | |
272 | 248 | | |
273 | 249 | | |
274 | 250 | | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
284 | 254 | | |
285 | 255 | | |
286 | | - | |
287 | | - | |
288 | | - | |
| 256 | + | |
289 | 257 | | |
290 | 258 | | |
291 | | - | |
292 | | - | |
293 | | - | |
| 259 | + | |
294 | 260 | | |
295 | 261 | | |
296 | 262 | | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
306 | 266 | | |
307 | 267 | | |
308 | | - | |
309 | | - | |
310 | | - | |
| 268 | + | |
311 | 269 | | |
312 | 270 | | |
313 | | - | |
314 | | - | |
315 | | - | |
| 271 | + | |
316 | 272 | | |
317 | 273 | | |
318 | 274 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
328 | 278 | | |
329 | 279 | | |
330 | | - | |
331 | | - | |
332 | | - | |
| 280 | + | |
333 | 281 | | |
334 | 282 | | |
335 | | - | |
336 | | - | |
337 | | - | |
| 283 | + | |
338 | 284 | | |
339 | 285 | | |
340 | 286 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
350 | 290 | | |
Lines changed: 20 additions & 60 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
| 148 | + | |
151 | 149 | | |
152 | 150 | | |
153 | | - | |
154 | | - | |
155 | | - | |
| 151 | + | |
156 | 152 | | |
157 | 153 | | |
158 | 154 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
168 | 158 | | |
169 | 159 | | |
170 | | - | |
171 | | - | |
172 | | - | |
| 160 | + | |
173 | 161 | | |
174 | 162 | | |
175 | | - | |
176 | | - | |
177 | | - | |
| 163 | + | |
178 | 164 | | |
179 | 165 | | |
180 | 166 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
190 | 170 | | |
191 | 171 | | |
192 | | - | |
193 | | - | |
194 | | - | |
| 172 | + | |
195 | 173 | | |
196 | 174 | | |
197 | | - | |
198 | | - | |
199 | | - | |
| 175 | + | |
200 | 176 | | |
201 | 177 | | |
202 | 178 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
212 | 182 | | |
213 | 183 | | |
214 | | - | |
215 | | - | |
216 | | - | |
| 184 | + | |
217 | 185 | | |
218 | 186 | | |
219 | | - | |
220 | | - | |
221 | | - | |
| 187 | + | |
222 | 188 | | |
223 | 189 | | |
224 | 190 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
234 | 194 | | |
0 commit comments