| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN
Y |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y | 16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN
Y |
| 17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N | 19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O
N |
| 20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #include "config.h" | 25 #include "config.h" |
| 26 | 26 |
| 27 #include "core/page/scrolling/ScrollingCoordinator.h" | 27 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 28 | 28 |
| 29 #include "core/layout/LayoutPart.h" |
| 29 #include "core/layout/compositing/CompositedLayerMapping.h" | 30 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 30 #include "core/layout/compositing/LayerCompositor.h" | 31 #include "core/layout/compositing/LayerCompositor.h" |
| 31 #include "core/page/Page.h" | 32 #include "core/page/Page.h" |
| 32 #include "core/rendering/RenderPart.h" | |
| 33 #include "core/rendering/RenderView.h" | 33 #include "core/rendering/RenderView.h" |
| 34 #include "core/testing/URLTestHelpers.h" | 34 #include "core/testing/URLTestHelpers.h" |
| 35 #include "platform/graphics/GraphicsLayer.h" | 35 #include "platform/graphics/GraphicsLayer.h" |
| 36 #include "public/platform/Platform.h" | 36 #include "public/platform/Platform.h" |
| 37 #include "public/platform/WebLayer.h" | 37 #include "public/platform/WebLayer.h" |
| 38 #include "public/platform/WebLayerPositionConstraint.h" | 38 #include "public/platform/WebLayerPositionConstraint.h" |
| 39 #include "public/platform/WebLayerTreeView.h" | 39 #include "public/platform/WebLayerTreeView.h" |
| 40 #include "public/platform/WebUnitTestSupport.h" | 40 #include "public/platform/WebUnitTestSupport.h" |
| 41 #include "public/web/WebSettings.h" | 41 #include "public/web/WebSettings.h" |
| 42 #include "public/web/WebViewClient.h" | 42 #include "public/web/WebViewClient.h" |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 navigateTo(m_baseURL + "iframe-scrolling.html"); | 444 navigateTo(m_baseURL + "iframe-scrolling.html"); |
| 445 forceFullCompositingUpdate(); | 445 forceFullCompositingUpdate(); |
| 446 | 446 |
| 447 // Verify the properties of the accelerated scrolling element starting from
the LayoutObject | 447 // Verify the properties of the accelerated scrolling element starting from
the LayoutObject |
| 448 // all the way to the WebLayer. | 448 // all the way to the WebLayer. |
| 449 Element* scrollableFrame = frame()->document()->getElementById("scrollable")
; | 449 Element* scrollableFrame = frame()->document()->getElementById("scrollable")
; |
| 450 ASSERT_TRUE(scrollableFrame); | 450 ASSERT_TRUE(scrollableFrame); |
| 451 | 451 |
| 452 LayoutObject* renderer = scrollableFrame->renderer(); | 452 LayoutObject* renderer = scrollableFrame->renderer(); |
| 453 ASSERT_TRUE(renderer); | 453 ASSERT_TRUE(renderer); |
| 454 ASSERT_TRUE(renderer->isRenderPart()); | 454 ASSERT_TRUE(renderer->isLayoutPart()); |
| 455 | 455 |
| 456 RenderPart* renderPart = toRenderPart(renderer); | 456 LayoutPart* layoutPart = toLayoutPart(renderer); |
| 457 ASSERT_TRUE(renderPart); | 457 ASSERT_TRUE(layoutPart); |
| 458 ASSERT_TRUE(renderPart->widget()); | 458 ASSERT_TRUE(layoutPart->widget()); |
| 459 ASSERT_TRUE(renderPart->widget()->isFrameView()); | 459 ASSERT_TRUE(layoutPart->widget()->isFrameView()); |
| 460 | 460 |
| 461 FrameView* innerFrameView = toFrameView(renderPart->widget()); | 461 FrameView* innerFrameView = toFrameView(layoutPart->widget()); |
| 462 RenderView* innerRenderView = innerFrameView->renderView(); | 462 RenderView* innerRenderView = innerFrameView->renderView(); |
| 463 ASSERT_TRUE(innerRenderView); | 463 ASSERT_TRUE(innerRenderView); |
| 464 | 464 |
| 465 LayerCompositor* innerCompositor = innerRenderView->compositor(); | 465 LayerCompositor* innerCompositor = innerRenderView->compositor(); |
| 466 ASSERT_TRUE(innerCompositor->inCompositingMode()); | 466 ASSERT_TRUE(innerCompositor->inCompositingMode()); |
| 467 ASSERT_TRUE(innerCompositor->scrollLayer()); | 467 ASSERT_TRUE(innerCompositor->scrollLayer()); |
| 468 | 468 |
| 469 GraphicsLayer* scrollLayer = innerCompositor->scrollLayer(); | 469 GraphicsLayer* scrollLayer = innerCompositor->scrollLayer(); |
| 470 ASSERT_EQ(innerFrameView, scrollLayer->scrollableArea()); | 470 ASSERT_EQ(innerFrameView, scrollLayer->scrollableArea()); |
| 471 | 471 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 488 navigateTo(m_baseURL + "rtl-iframe.html"); | 488 navigateTo(m_baseURL + "rtl-iframe.html"); |
| 489 forceFullCompositingUpdate(); | 489 forceFullCompositingUpdate(); |
| 490 | 490 |
| 491 // Verify the properties of the accelerated scrolling element starting from
the LayoutObject | 491 // Verify the properties of the accelerated scrolling element starting from
the LayoutObject |
| 492 // all the way to the WebLayer. | 492 // all the way to the WebLayer. |
| 493 Element* scrollableFrame = frame()->document()->getElementById("scrollable")
; | 493 Element* scrollableFrame = frame()->document()->getElementById("scrollable")
; |
| 494 ASSERT_TRUE(scrollableFrame); | 494 ASSERT_TRUE(scrollableFrame); |
| 495 | 495 |
| 496 LayoutObject* renderer = scrollableFrame->renderer(); | 496 LayoutObject* renderer = scrollableFrame->renderer(); |
| 497 ASSERT_TRUE(renderer); | 497 ASSERT_TRUE(renderer); |
| 498 ASSERT_TRUE(renderer->isRenderPart()); | 498 ASSERT_TRUE(renderer->isLayoutPart()); |
| 499 | 499 |
| 500 RenderPart* renderPart = toRenderPart(renderer); | 500 LayoutPart* layoutPart = toLayoutPart(renderer); |
| 501 ASSERT_TRUE(renderPart); | 501 ASSERT_TRUE(layoutPart); |
| 502 ASSERT_TRUE(renderPart->widget()); | 502 ASSERT_TRUE(layoutPart->widget()); |
| 503 ASSERT_TRUE(renderPart->widget()->isFrameView()); | 503 ASSERT_TRUE(layoutPart->widget()->isFrameView()); |
| 504 | 504 |
| 505 FrameView* innerFrameView = toFrameView(renderPart->widget()); | 505 FrameView* innerFrameView = toFrameView(layoutPart->widget()); |
| 506 RenderView* innerRenderView = innerFrameView->renderView(); | 506 RenderView* innerRenderView = innerFrameView->renderView(); |
| 507 ASSERT_TRUE(innerRenderView); | 507 ASSERT_TRUE(innerRenderView); |
| 508 | 508 |
| 509 LayerCompositor* innerCompositor = innerRenderView->compositor(); | 509 LayerCompositor* innerCompositor = innerRenderView->compositor(); |
| 510 ASSERT_TRUE(innerCompositor->inCompositingMode()); | 510 ASSERT_TRUE(innerCompositor->inCompositingMode()); |
| 511 ASSERT_TRUE(innerCompositor->scrollLayer()); | 511 ASSERT_TRUE(innerCompositor->scrollLayer()); |
| 512 | 512 |
| 513 GraphicsLayer* scrollLayer = innerCompositor->scrollLayer(); | 513 GraphicsLayer* scrollLayer = innerCompositor->scrollLayer(); |
| 514 ASSERT_EQ(innerFrameView, scrollLayer->scrollableArea()); | 514 ASSERT_EQ(innerFrameView, scrollLayer->scrollableArea()); |
| 515 | 515 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 WebLayer* contentsLayer = scrollbarGraphicsLayer->contentsLayer(); | 575 WebLayer* contentsLayer = scrollbarGraphicsLayer->contentsLayer(); |
| 576 ASSERT_TRUE(contentsLayer); | 576 ASSERT_TRUE(contentsLayer); |
| 577 | 577 |
| 578 // After scrollableAreaScrollbarLayerDidChange, | 578 // After scrollableAreaScrollbarLayerDidChange, |
| 579 // if the main frame's scrollbarLayer is opaque, | 579 // if the main frame's scrollbarLayer is opaque, |
| 580 // contentsLayer should be opaque too. | 580 // contentsLayer should be opaque too. |
| 581 ASSERT_EQ(platformLayer->opaque(), contentsLayer->opaque()); | 581 ASSERT_EQ(platformLayer->opaque(), contentsLayer->opaque()); |
| 582 } | 582 } |
| 583 | 583 |
| 584 } // namespace | 584 } // namespace |
| OLD | NEW |