OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/layout/LayoutTestHelper.h" | 5 #include "core/layout/LayoutTestHelper.h" |
6 #include "core/layout/LayoutView.h" | 6 #include "core/layout/LayoutView.h" |
7 #include "core/layout/PaintInvalidationState.h" | 7 #include "core/layout/PaintInvalidationState.h" |
8 #include "core/paint/PaintLayer.h" | 8 #include "core/paint/PaintLayer.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 EXPECT_EQ(LayoutRect(-40, 0, 240, 110), containerOverflowRect); | 215 EXPECT_EQ(LayoutRect(-40, 0, 240, 110), containerOverflowRect); |
216 rect = containerOverflowRect; | 216 rect = containerOverflowRect; |
217 EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(container, rect)); | 217 EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(container, rect)); |
218 EXPECT_EQ(LayoutRect(0, 0, 240, 110), rect); | 218 EXPECT_EQ(LayoutRect(0, 0, 240, 110), rect); |
219 rect = containerOverflowRect; | 219 rect = containerOverflowRect; |
220 EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(&layoutView(), rect)); | 220 EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(&layoutView(), rect)); |
221 EXPECT_EQ(LayoutRect(222, 111, 240, 110), rect); | 221 EXPECT_EQ(LayoutRect(222, 111, 240, 110), rect); |
222 checkPaintInvalidationStateRectMapping(rect, containerOverflowRect, *contain
er, layoutView(), layoutView()); | 222 checkPaintInvalidationStateRectMapping(rect, containerOverflowRect, *contain
er, layoutView(), layoutView()); |
223 } | 223 } |
224 | 224 |
225 TEST_F(VisualRectMappingTest, ContainerOverflowClip) | 225 TEST_F(VisualRectMappingTest, ContainerOverflowScroll) |
226 { | 226 { |
227 setBodyInnerHTML( | 227 setBodyInnerHTML( |
228 "<div id='container' style='position: absolute; top: 111px; left: 222px;
" | 228 "<div id='container' style='position: absolute; top: 111px; left: 222px;
" |
229 " border: 10px solid red; overflow: hidden; width: 50px; height: 80px
;'>" | 229 " border: 10px solid red; overflow: scroll; width: 50px; height: 80px
;'>" |
230 " <div id='target' style='box-shadow: 40px 20px black; width: 100px;
height: 90px'></div>" | 230 " <div id='target' style='box-shadow: 40px 20px black; width: 100px;
height: 90px'></div>" |
231 "</div>"); | 231 "</div>"); |
232 | 232 |
233 LayoutBlock* container = toLayoutBlock(getLayoutObjectByElementId("container
")); | 233 LayoutBlock* container = toLayoutBlock(getLayoutObjectByElementId("container
")); |
234 EXPECT_EQ(LayoutUnit(0), container->scrollTop()); | 234 EXPECT_EQ(LayoutUnit(0), container->scrollTop()); |
235 EXPECT_EQ(LayoutUnit(0), container->scrollLeft()); | 235 EXPECT_EQ(LayoutUnit(0), container->scrollLeft()); |
236 container->setScrollTop(LayoutUnit(7)); | 236 container->setScrollTop(LayoutUnit(7)); |
237 container->setScrollLeft(LayoutUnit(8)); | 237 container->setScrollLeft(LayoutUnit(8)); |
238 document().view()->updateAllLifecyclePhases(); | 238 document().view()->updateAllLifecyclePhases(); |
239 | 239 |
240 LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target")); | 240 LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target")); |
241 LayoutRect targetOverflowRect = target->localOverflowRectForPaintInvalidatio
n(); | 241 LayoutRect targetOverflowRect = target->localOverflowRectForPaintInvalidatio
n(); |
242 // 140 = width(100) + box_shadow_offset_x(40) | 242 // 140 = width(100) + box_shadow_offset_x(40) |
243 // 110 = height(90) + box_shadow_offset_y(20) | 243 // 110 = height(90) + box_shadow_offset_y(20) |
244 EXPECT_EQ(LayoutRect(0, 0, 140, 110), targetOverflowRect); | 244 EXPECT_EQ(LayoutRect(0, 0, 140, 110), targetOverflowRect); |
245 LayoutRect rect = targetOverflowRect; | 245 LayoutRect rect = targetOverflowRect; |
246 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(target, rect)); | 246 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(target, rect)); |
247 EXPECT_EQ(LayoutRect(0, 0, 140, 110), rect); | 247 EXPECT_EQ(LayoutRect(0, 0, 140, 110), rect); |
248 | 248 |
249 rect = targetOverflowRect; | 249 rect = targetOverflowRect; |
250 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(container, rect)); | 250 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(container, rect)); |
251 // 2 = target_x(0) + container_border_left(10) - scroll_left(8) | 251 // 2 = target_x(0) + container_border_left(10) - scroll_left(8) |
252 // 3 = target_y(0) + container_border_top(10) - scroll_top(7) | 252 // 3 = target_y(0) + container_border_top(10) - scroll_top(7) |
253 // Rect is not clipped by container's overflow clip. | 253 // Rect is not clipped by container's overflow clip because of overflow:scro
ll. |
254 EXPECT_EQ(LayoutRect(2, 3, 140, 110), rect); | 254 EXPECT_EQ(LayoutRect(2, 3, 140, 110), rect); |
255 | 255 |
256 rect = targetOverflowRect; | 256 rect = targetOverflowRect; |
257 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect)); | 257 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect)); |
258 // (2, 3, 140, 100) is first clipped by container's overflow clip, to (10, 1
0, 50, 80), | 258 // (2, 3, 140, 100) is first clipped by container's overflow clip, to (10, 1
0, 50, 80), |
259 // then is by added container's offset in LayoutView (111, 222). | 259 // then is by added container's offset in LayoutView (111, 222). |
260 EXPECT_EQ(LayoutRect(232, 121, 50, 80), rect); | 260 EXPECT_EQ(LayoutRect(232, 121, 50, 80), rect); |
261 checkPaintInvalidationStateRectMapping(rect, targetOverflowRect, *target, la
youtView(), layoutView()); | 261 checkPaintInvalidationStateRectMapping(rect, targetOverflowRect, *target, la
youtView(), layoutView()); |
262 | 262 |
263 LayoutRect containerOverflowRect = container->localOverflowRectForPaintInval
idation(); | 263 LayoutRect containerOverflowRect = container->localOverflowRectForPaintInval
idation(); |
264 // Because container has overflow clip, its visual overflow doesn't include
overflow from children. | 264 // Because container has overflow clip, its visual overflow doesn't include
overflow from children. |
265 // 70 = width(50) + border_left_width(10) + border_right_width(10) | 265 // 70 = width(50) + border_left_width(10) + border_right_width(10) |
266 // 100 = height(80) + border_top_width(10) + border_bottom_width(10) | 266 // 100 = height(80) + border_top_width(10) + border_bottom_width(10) |
267 EXPECT_EQ(LayoutRect(0, 0, 70, 100), containerOverflowRect); | 267 EXPECT_EQ(LayoutRect(0, 0, 70, 100), containerOverflowRect); |
268 rect = containerOverflowRect; | 268 rect = containerOverflowRect; |
269 EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(container, rect)); | 269 EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(container, rect)); |
270 // Container should not apply overflow clip on its own overflow rect. | 270 // Container should not apply overflow clip on its own overflow rect. |
271 EXPECT_EQ(LayoutRect(0, 0, 70, 100), rect); | 271 EXPECT_EQ(LayoutRect(0, 0, 70, 100), rect); |
272 | 272 |
273 rect = containerOverflowRect; | 273 rect = containerOverflowRect; |
274 EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(&layoutView(), rect)); | 274 EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(&layoutView(), rect)); |
275 EXPECT_EQ(LayoutRect(222, 111, 70, 100), rect); | 275 EXPECT_EQ(LayoutRect(222, 111, 70, 100), rect); |
276 checkPaintInvalidationStateRectMapping(rect, containerOverflowRect, *contain
er, layoutView(), layoutView()); | 276 checkPaintInvalidationStateRectMapping(rect, containerOverflowRect, *contain
er, layoutView(), layoutView()); |
277 } | 277 } |
278 | 278 |
279 TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowClip) | 279 TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowScroll) |
280 { | 280 { |
281 setBodyInnerHTML( | 281 setBodyInnerHTML( |
282 "<div id='container' style='writing-mode: vertical-rl; position: absolut
e; top: 111px; left: 222px;" | 282 "<div id='container' style='writing-mode: vertical-rl; position: absolut
e; top: 111px; left: 222px;" |
283 " border: solid red; border-width: 10px 20px 30px 40px;" | 283 " border: solid red; border-width: 10px 20px 30px 40px;" |
284 " overflow: hidden; width: 50px; height: 80px'>" | 284 " overflow: scroll; width: 50px; height: 80px'>" |
285 " <div id='target' style='box-shadow: 40px 20px black; width: 100px;
height: 90px'></div>" | 285 " <div id='target' style='box-shadow: 40px 20px black; width: 100px;
height: 90px'></div>" |
286 " <div style='width: 100px; height: 100px'></div>" | 286 " <div style='width: 100px; height: 100px'></div>" |
287 "</div>"); | 287 "</div>"); |
288 | 288 |
289 LayoutBlock* container = toLayoutBlock(getLayoutObjectByElementId("container
")); | 289 LayoutBlock* container = toLayoutBlock(getLayoutObjectByElementId("container
")); |
290 EXPECT_EQ(LayoutUnit(0), container->scrollTop()); | 290 EXPECT_EQ(LayoutUnit(0), container->scrollTop()); |
291 // The initial scroll offset is to the left-most because of flipped blocks w
riting mode. | 291 // The initial scroll offset is to the left-most because of flipped blocks w
riting mode. |
292 // 150 = total_layout_overflow(100 + 100) - width(50) | 292 // 150 = total_layout_overflow(100 + 100) - width(50) |
293 EXPECT_EQ(LayoutUnit(150), container->scrollLeft()); | 293 EXPECT_EQ(LayoutUnit(150), container->scrollLeft()); |
294 container->setScrollTop(LayoutUnit(7)); | 294 container->setScrollTop(LayoutUnit(7)); |
295 container->setScrollLeft(LayoutUnit(142)); // Scroll to the right by 8 pixel
s. | 295 container->setScrollLeft(LayoutUnit(142)); // Scroll to the right by 8 pixel
s. |
296 document().view()->updateAllLifecyclePhases(); | 296 document().view()->updateAllLifecyclePhases(); |
297 | 297 |
298 LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target")); | 298 LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target")); |
299 LayoutRect targetOverflowRect = target->localOverflowRectForPaintInvalidatio
n(); | 299 LayoutRect targetOverflowRect = target->localOverflowRectForPaintInvalidatio
n(); |
300 // -40 = -box_shadow_offset_x(40) (with target's top-right corner as the ori
gin) | 300 // -40 = -box_shadow_offset_x(40) (with target's top-right corner as the ori
gin) |
301 // 140 = width(100) + box_shadow_offset_x(40) | 301 // 140 = width(100) + box_shadow_offset_x(40) |
302 // 110 = height(90) + box_shadow_offset_y(20) | 302 // 110 = height(90) + box_shadow_offset_y(20) |
303 EXPECT_EQ(LayoutRect(-40, 0, 140, 110), targetOverflowRect); | 303 EXPECT_EQ(LayoutRect(-40, 0, 140, 110), targetOverflowRect); |
304 | 304 |
305 LayoutRect rect = targetOverflowRect; | 305 LayoutRect rect = targetOverflowRect; |
306 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(target, rect)); | 306 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(target, rect)); |
307 // This rect is in physical coordinates of target. | 307 // This rect is in physical coordinates of target. |
308 EXPECT_EQ(LayoutRect(0, 0, 140, 110), rect); | 308 EXPECT_EQ(LayoutRect(0, 0, 140, 110), rect); |
309 | 309 |
310 rect = targetOverflowRect; | 310 rect = targetOverflowRect; |
311 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(container, rect)); | 311 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(container, rect)); |
312 // -2 = target_physical_x(100) + container_border_left(40) - scroll_left(142
) | 312 // -2 = target_physical_x(100) + container_border_left(40) - scroll_left(142
) |
313 // 3 = target_y(0) + container_border_top(10) - scroll_top(7) | 313 // 3 = target_y(0) + container_border_top(10) - scroll_top(7) |
314 // Rect is not clipped by container's overflow clip. | 314 // Rect is clipped by container's overflow clip because of overflow:scroll. |
315 EXPECT_EQ(LayoutRect(-2, 3, 140, 110), rect); | 315 EXPECT_EQ(LayoutRect(-2, 3, 140, 110), rect); |
316 | 316 |
317 rect = targetOverflowRect; | 317 rect = targetOverflowRect; |
318 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect)); | 318 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect)); |
319 // (-2, 3, 140, 100) is first clipped by container's overflow clip, to (40,
10, 50, 80), | 319 // (-2, 3, 140, 100) is first clipped by container's overflow clip, to (40,
10, 50, 80), |
320 // then is added by container's offset in LayoutView (111, 222). | 320 // then is added by container's offset in LayoutView (111, 222). |
321 // TODO(crbug.com/600039): rect.x() should be 262 (left + border-left), but
is offset | 321 // TODO(crbug.com/600039): rect.x() should be 262 (left + border-left), but
is offset |
322 // by extra horizontal border-widths because of layout error. | 322 // by extra horizontal border-widths because of layout error. |
323 EXPECT_EQ(LayoutRect(322, 121, 50, 80), rect); | 323 EXPECT_EQ(LayoutRect(322, 121, 50, 80), rect); |
324 checkPaintInvalidationStateRectMapping(rect, targetOverflowRect, *target, la
youtView(), layoutView()); | 324 checkPaintInvalidationStateRectMapping(rect, targetOverflowRect, *target, la
youtView(), layoutView()); |
325 | 325 |
326 LayoutRect containerOverflowRect = container->localOverflowRectForPaintInval
idation(); | 326 LayoutRect containerOverflowRect = container->localOverflowRectForPaintInval
idation(); |
327 // Because container has overflow clip, its visual overflow doesn't include
overflow from children. | 327 // Because container has overflow clip, its visual overflow doesn't include
overflow from children. |
328 // 110 = width(50) + border_left_width(40) + border_right_width(20) | 328 // 110 = width(50) + border_left_width(40) + border_right_width(20) |
329 // 120 = height(80) + border_top_width(10) + border_bottom_width(30) | 329 // 120 = height(80) + border_top_width(10) + border_bottom_width(30) |
330 EXPECT_EQ(LayoutRect(0, 0, 110, 120), containerOverflowRect); | 330 EXPECT_EQ(LayoutRect(0, 0, 110, 120), containerOverflowRect); |
331 | 331 |
332 rect = containerOverflowRect; | 332 rect = containerOverflowRect; |
333 EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(container, rect)); | 333 EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(container, rect)); |
334 EXPECT_EQ(LayoutRect(0, 0, 110, 120), rect); | 334 EXPECT_EQ(LayoutRect(0, 0, 110, 120), rect); |
335 | 335 |
336 rect = containerOverflowRect; | 336 rect = containerOverflowRect; |
337 EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(&layoutView(), rect)); | 337 EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(&layoutView(), rect)); |
338 // TODO(crbug.com/600039): rect.x() should be 222 (left), but is offset by e
xtra horizontal | 338 // TODO(crbug.com/600039): rect.x() should be 222 (left), but is offset by e
xtra horizontal |
339 // border-widths because of layout error. | 339 // border-widths because of layout error. |
340 EXPECT_EQ(LayoutRect(282, 111, 110, 120), rect); | 340 EXPECT_EQ(LayoutRect(282, 111, 110, 120), rect); |
341 checkPaintInvalidationStateRectMapping(rect, containerOverflowRect, *contain
er, layoutView(), layoutView()); | 341 checkPaintInvalidationStateRectMapping(rect, containerOverflowRect, *contain
er, layoutView(), layoutView()); |
342 } | 342 } |
343 | 343 |
| 344 TEST_F(VisualRectMappingTest, ContainerOverflowHidden) |
| 345 { |
| 346 setBodyInnerHTML( |
| 347 "<div id='container' style='position: absolute; top: 111px; left: 222px;
" |
| 348 " border: 10px solid red; overflow: hidden; width: 50px; height: 80px
;'>" |
| 349 " <div id='target' style='box-shadow: 40px 20px black; width: 100px;
height: 90px'></div>" |
| 350 "</div>"); |
| 351 |
| 352 LayoutBlock* container = toLayoutBlock(getLayoutObjectByElementId("container
")); |
| 353 EXPECT_EQ(LayoutUnit(0), container->scrollTop()); |
| 354 EXPECT_EQ(LayoutUnit(0), container->scrollLeft()); |
| 355 container->setScrollTop(LayoutUnit(27)); |
| 356 container->setScrollLeft(LayoutUnit(28)); |
| 357 document().view()->updateAllLifecyclePhases(); |
| 358 |
| 359 LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target")); |
| 360 LayoutRect targetOverflowRect = target->localOverflowRectForPaintInvalidatio
n(); |
| 361 // 140 = width(100) + box_shadow_offset_x(40) |
| 362 // 110 = height(90) + box_shadow_offset_y(20) |
| 363 EXPECT_EQ(LayoutRect(0, 0, 140, 110), targetOverflowRect); |
| 364 LayoutRect rect = targetOverflowRect; |
| 365 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(target, rect)); |
| 366 EXPECT_EQ(LayoutRect(0, 0, 140, 110), rect); |
| 367 |
| 368 rect = targetOverflowRect; |
| 369 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(container, rect)); |
| 370 // Rect is clipped by container's overflow clip. |
| 371 EXPECT_EQ(LayoutRect(10, 10, 50, 80), rect); |
| 372 } |
| 373 |
| 374 TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowHidden) |
| 375 { |
| 376 setBodyInnerHTML( |
| 377 "<div id='container' style='writing-mode: vertical-rl; position: absolut
e; top: 111px; left: 222px;" |
| 378 " border: solid red; border-width: 10px 20px 30px 40px;" |
| 379 " overflow: hidden; width: 50px; height: 80px'>" |
| 380 " <div id='target' style='box-shadow: 40px 20px black; width: 100px;
height: 90px'></div>" |
| 381 " <div style='width: 100px; height: 100px'></div>" |
| 382 "</div>"); |
| 383 |
| 384 LayoutBlock* container = toLayoutBlock(getLayoutObjectByElementId("container
")); |
| 385 EXPECT_EQ(LayoutUnit(0), container->scrollTop()); |
| 386 // The initial scroll offset is to the left-most because of flipped blocks w
riting mode. |
| 387 // 150 = total_layout_overflow(100 + 100) - width(50) |
| 388 EXPECT_EQ(LayoutUnit(150), container->scrollLeft()); |
| 389 container->setScrollTop(LayoutUnit(7)); |
| 390 container->setScrollLeft(LayoutUnit(82)); // Scroll to the right by 8 pixels
. |
| 391 document().view()->updateAllLifecyclePhases(); |
| 392 |
| 393 LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target")); |
| 394 LayoutRect targetOverflowRect = target->localOverflowRectForPaintInvalidatio
n(); |
| 395 // -40 = -box_shadow_offset_x(40) (with target's top-right corner as the ori
gin) |
| 396 // 140 = width(100) + box_shadow_offset_x(40) |
| 397 // 110 = height(90) + box_shadow_offset_y(20) |
| 398 EXPECT_EQ(LayoutRect(-40, 0, 140, 110), targetOverflowRect); |
| 399 |
| 400 LayoutRect rect = targetOverflowRect; |
| 401 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(target, rect)); |
| 402 // This rect is in physical coordinates of target. |
| 403 EXPECT_EQ(LayoutRect(0, 0, 140, 110), rect); |
| 404 |
| 405 rect = targetOverflowRect; |
| 406 EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(container, rect)); |
| 407 // 58 = target_physical_x(100) + container_border_left(40) - scroll_left(58) |
| 408 // The other sides of the rect are clipped by container's overflow clip. |
| 409 EXPECT_EQ(LayoutRect(58, 10, 32, 80), rect); |
| 410 } |
| 411 |
344 TEST_F(VisualRectMappingTest, DifferentPaintInvalidaitionContainerForAbsolutePos
ition) | 412 TEST_F(VisualRectMappingTest, DifferentPaintInvalidaitionContainerForAbsolutePos
ition) |
345 { | 413 { |
346 enableCompositing(); | 414 enableCompositing(); |
347 document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true); | 415 document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true); |
348 | 416 |
349 setBodyInnerHTML( | 417 setBodyInnerHTML( |
350 "<div id='stacking-context' style='opacity: 0.9; background: blue; will-
change: transform'>" | 418 "<div id='stacking-context' style='opacity: 0.9; background: blue; will-
change: transform'>" |
351 " <div id='scroller' style='overflow: scroll; width: 80px; height: 80
px'>" | 419 " <div id='scroller' style='overflow: scroll; width: 80px; height: 80
px'>" |
352 " <div id='absolute' style='position: absolute; top: 111px; left:
222px; width: 50px; height: 50px; background: green'></div>" | 420 " <div id='absolute' style='position: absolute; top: 111px; left:
222px; width: 50px; height: 50px; background: green'></div>" |
353 " <div id='normal-flow' style='width: 2000px; height: 2000px; bac
kground: yellow'></div>" | 421 " <div id='normal-flow' style='width: 2000px; height: 2000px; bac
kground: yellow'></div>" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 LayoutRect absoluteOverflowRect = absolute->localOverflowRectForPaintInvalid
ation(); | 475 LayoutRect absoluteOverflowRect = absolute->localOverflowRectForPaintInvalid
ation(); |
408 EXPECT_EQ(LayoutRect(0, 0, 50, 50), absoluteOverflowRect); | 476 EXPECT_EQ(LayoutRect(0, 0, 50, 50), absoluteOverflowRect); |
409 LayoutRect rect = absoluteOverflowRect; | 477 LayoutRect rect = absoluteOverflowRect; |
410 EXPECT_TRUE(absolute->mapToVisualRectInAncestorSpace(stackingContext, rect))
; | 478 EXPECT_TRUE(absolute->mapToVisualRectInAncestorSpace(stackingContext, rect))
; |
411 // -172 = top(50) - y_offset_of_stacking_context(222) | 479 // -172 = top(50) - y_offset_of_stacking_context(222) |
412 EXPECT_EQ(LayoutRect(50, -172, 50, 50), rect); | 480 EXPECT_EQ(LayoutRect(50, -172, 50, 50), rect); |
413 checkPaintInvalidationStateRectMapping(rect, absoluteOverflowRect, *absolute
, layoutView(), *stackingContext); | 481 checkPaintInvalidationStateRectMapping(rect, absoluteOverflowRect, *absolute
, layoutView(), *stackingContext); |
414 } | 482 } |
415 | 483 |
416 } // namespace blink | 484 } // namespace blink |
OLD | NEW |