| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "core/frame/FrameHost.h" | 42 #include "core/frame/FrameHost.h" |
| 43 #include "core/frame/LocalFrame.h" | 43 #include "core/frame/LocalFrame.h" |
| 44 #include "core/frame/Settings.h" | 44 #include "core/frame/Settings.h" |
| 45 #include "core/html/HTMLFrameElement.h" | 45 #include "core/html/HTMLFrameElement.h" |
| 46 #include "core/html/HTMLPlugInElement.h" | 46 #include "core/html/HTMLPlugInElement.h" |
| 47 #include "core/html/parser/TextResourceDecoder.h" | 47 #include "core/html/parser/TextResourceDecoder.h" |
| 48 #include "core/inspector/InspectorInstrumentation.h" | 48 #include "core/inspector/InspectorInstrumentation.h" |
| 49 #include "core/inspector/InspectorTraceEvents.h" | 49 #include "core/inspector/InspectorTraceEvents.h" |
| 50 #include "core/layout/Layer.h" | 50 #include "core/layout/Layer.h" |
| 51 #include "core/layout/LayoutCounter.h" | 51 #include "core/layout/LayoutCounter.h" |
| 52 #include "core/layout/LayoutPart.h" |
| 52 #include "core/layout/LayoutTheme.h" | 53 #include "core/layout/LayoutTheme.h" |
| 53 #include "core/layout/TextAutosizer.h" | 54 #include "core/layout/TextAutosizer.h" |
| 54 #include "core/layout/compositing/CompositedLayerMapping.h" | 55 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 55 #include "core/layout/compositing/CompositedSelectionBound.h" | 56 #include "core/layout/compositing/CompositedSelectionBound.h" |
| 56 #include "core/layout/compositing/LayerCompositor.h" | 57 #include "core/layout/compositing/LayerCompositor.h" |
| 57 #include "core/layout/style/LayoutStyle.h" | 58 #include "core/layout/style/LayoutStyle.h" |
| 58 #include "core/loader/FrameLoader.h" | 59 #include "core/loader/FrameLoader.h" |
| 59 #include "core/loader/FrameLoaderClient.h" | 60 #include "core/loader/FrameLoaderClient.h" |
| 60 #include "core/page/Chrome.h" | 61 #include "core/page/Chrome.h" |
| 61 #include "core/page/ChromeClient.h" | 62 #include "core/page/ChromeClient.h" |
| 62 #include "core/page/EventHandler.h" | 63 #include "core/page/EventHandler.h" |
| 63 #include "core/page/FocusController.h" | 64 #include "core/page/FocusController.h" |
| 64 #include "core/page/FrameTree.h" | 65 #include "core/page/FrameTree.h" |
| 65 #include "core/page/Page.h" | 66 #include "core/page/Page.h" |
| 66 #include "core/page/scrolling/ScrollingCoordinator.h" | 67 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 67 #include "core/paint/FramePainter.h" | 68 #include "core/paint/FramePainter.h" |
| 68 #include "core/rendering/RenderEmbeddedObject.h" | 69 #include "core/rendering/RenderEmbeddedObject.h" |
| 69 #include "core/rendering/RenderListBox.h" | 70 #include "core/rendering/RenderListBox.h" |
| 70 #include "core/rendering/RenderPart.h" | |
| 71 #include "core/rendering/RenderScrollbar.h" | 71 #include "core/rendering/RenderScrollbar.h" |
| 72 #include "core/rendering/RenderScrollbarPart.h" | 72 #include "core/rendering/RenderScrollbarPart.h" |
| 73 #include "core/rendering/RenderView.h" | 73 #include "core/rendering/RenderView.h" |
| 74 #include "core/rendering/svg/RenderSVGRoot.h" | 74 #include "core/rendering/svg/RenderSVGRoot.h" |
| 75 #include "core/svg/SVGDocumentExtensions.h" | 75 #include "core/svg/SVGDocumentExtensions.h" |
| 76 #include "core/svg/SVGSVGElement.h" | 76 #include "core/svg/SVGSVGElement.h" |
| 77 #include "platform/HostWindow.h" | 77 #include "platform/HostWindow.h" |
| 78 #include "platform/RuntimeEnabledFeatures.h" | 78 #include "platform/RuntimeEnabledFeatures.h" |
| 79 #include "platform/ScriptForbiddenScope.h" | 79 #include "platform/ScriptForbiddenScope.h" |
| 80 #include "platform/TraceEvent.h" | 80 #include "platform/TraceEvent.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 { | 386 { |
| 387 // For querying Layer::compositingState() when invalidating scrollbars. | 387 // For querying Layer::compositingState() when invalidating scrollbars. |
| 388 // FIXME: do all scrollbar invalidations after layout of all frames is compl
ete. It's currently not recursively true. | 388 // FIXME: do all scrollbar invalidations after layout of all frames is compl
ete. It's currently not recursively true. |
| 389 DisableCompositingQueryAsserts disabler; | 389 DisableCompositingQueryAsserts disabler; |
| 390 if (!parent()) { | 390 if (!parent()) { |
| 391 if (HostWindow* window = hostWindow()) | 391 if (HostWindow* window = hostWindow()) |
| 392 window->invalidateRect(rect); | 392 window->invalidateRect(rect); |
| 393 return; | 393 return; |
| 394 } | 394 } |
| 395 | 395 |
| 396 RenderPart* renderer = m_frame->ownerRenderer(); | 396 LayoutPart* renderer = m_frame->ownerRenderer(); |
| 397 if (!renderer) | 397 if (!renderer) |
| 398 return; | 398 return; |
| 399 | 399 |
| 400 IntRect paintInvalidationRect = rect; | 400 IntRect paintInvalidationRect = rect; |
| 401 paintInvalidationRect.move(renderer->borderLeft() + renderer->paddingLeft(), | 401 paintInvalidationRect.move(renderer->borderLeft() + renderer->paddingLeft(), |
| 402 renderer->borderTop() + renderer->paddingTop()); | 402 renderer->borderTop() + renderer->paddingTop()); |
| 403 // FIXME: We should not allow paint invalidation out of paint invalidation s
tate. crbug.com/457415 | 403 // FIXME: We should not allow paint invalidation out of paint invalidation s
tate. crbug.com/457415 |
| 404 DisablePaintInvalidationStateAsserts paintInvalidationAssertDisabler; | 404 DisablePaintInvalidationStateAsserts paintInvalidationAssertDisabler; |
| 405 renderer->invalidatePaintRectangle(paintInvalidationRect); | 405 renderer->invalidatePaintRectangle(paintInvalidationRect); |
| 406 } | 406 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 } | 501 } |
| 502 | 502 |
| 503 // If the <body> didn't have a custom style, then the root element might. | 503 // If the <body> didn't have a custom style, then the root element might. |
| 504 Element* docElement = doc ? doc->documentElement() : 0; | 504 Element* docElement = doc ? doc->documentElement() : 0; |
| 505 if (docElement && docElement->renderer() && docElement->renderer()->style()-
>hasPseudoStyle(SCROLLBAR)) { | 505 if (docElement && docElement->renderer() && docElement->renderer()->style()-
>hasPseudoStyle(SCROLLBAR)) { |
| 506 customScrollbarElement = docElement; | 506 customScrollbarElement = docElement; |
| 507 return true; | 507 return true; |
| 508 } | 508 } |
| 509 | 509 |
| 510 // If we have an owning ipage/LocalFrame element, then it can set the custom
scrollbar also. | 510 // If we have an owning ipage/LocalFrame element, then it can set the custom
scrollbar also. |
| 511 RenderPart* frameRenderer = m_frame->ownerRenderer(); | 511 LayoutPart* frameRenderer = m_frame->ownerRenderer(); |
| 512 if (frameRenderer && frameRenderer->style()->hasPseudoStyle(SCROLLBAR)) { | 512 if (frameRenderer && frameRenderer->style()->hasPseudoStyle(SCROLLBAR)) { |
| 513 customScrollbarFrame = m_frame.get(); | 513 customScrollbarFrame = m_frame.get(); |
| 514 return true; | 514 return true; |
| 515 } | 515 } |
| 516 | 516 |
| 517 return false; | 517 return false; |
| 518 } | 518 } |
| 519 | 519 |
| 520 PassRefPtrWillBeRawPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientatio
n orientation) | 520 PassRefPtrWillBeRawPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientatio
n orientation) |
| 521 { | 521 { |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 return frameOwnerRenderer && frameOwnerRenderer->enclosingLayer()->enclosing
LayerForPaintInvalidationCrossingFrameBoundaries(); | 764 return frameOwnerRenderer && frameOwnerRenderer->enclosingLayer()->enclosing
LayerForPaintInvalidationCrossingFrameBoundaries(); |
| 765 } | 765 } |
| 766 | 766 |
| 767 LayoutObject* FrameView::layoutRoot(bool onlyDuringLayout) const | 767 LayoutObject* FrameView::layoutRoot(bool onlyDuringLayout) const |
| 768 { | 768 { |
| 769 return onlyDuringLayout && layoutPending() ? nullptr : m_layoutSubtreeRoot; | 769 return onlyDuringLayout && layoutPending() ? nullptr : m_layoutSubtreeRoot; |
| 770 } | 770 } |
| 771 | 771 |
| 772 inline void FrameView::forceLayoutParentViewIfNeeded() | 772 inline void FrameView::forceLayoutParentViewIfNeeded() |
| 773 { | 773 { |
| 774 RenderPart* ownerRenderer = m_frame->ownerRenderer(); | 774 LayoutPart* ownerRenderer = m_frame->ownerRenderer(); |
| 775 if (!ownerRenderer || !ownerRenderer->frame()) | 775 if (!ownerRenderer || !ownerRenderer->frame()) |
| 776 return; | 776 return; |
| 777 | 777 |
| 778 RenderBox* contentBox = embeddedContentBox(); | 778 RenderBox* contentBox = embeddedContentBox(); |
| 779 if (!contentBox) | 779 if (!contentBox) |
| 780 return; | 780 return; |
| 781 | 781 |
| 782 RenderSVGRoot* svgRoot = toRenderSVGRoot(contentBox); | 782 RenderSVGRoot* svgRoot = toRenderSVGRoot(contentBox); |
| 783 if (svgRoot->everHadLayout() && !svgRoot->needsLayout()) | 783 if (svgRoot->everHadLayout() && !svgRoot->needsLayout()) |
| 784 return; | 784 return; |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 return nullptr; | 1149 return nullptr; |
| 1150 | 1150 |
| 1151 // Curently only embedded SVG documents participate in the size-negotiation
logic. | 1151 // Curently only embedded SVG documents participate in the size-negotiation
logic. |
| 1152 if (firstChild->isSVGRoot()) | 1152 if (firstChild->isSVGRoot()) |
| 1153 return toRenderBox(firstChild); | 1153 return toRenderBox(firstChild); |
| 1154 | 1154 |
| 1155 return nullptr; | 1155 return nullptr; |
| 1156 } | 1156 } |
| 1157 | 1157 |
| 1158 | 1158 |
| 1159 void FrameView::addPart(RenderPart* object) | 1159 void FrameView::addPart(LayoutPart* object) |
| 1160 { | 1160 { |
| 1161 m_parts.add(object); | 1161 m_parts.add(object); |
| 1162 } | 1162 } |
| 1163 | 1163 |
| 1164 void FrameView::removePart(RenderPart* object) | 1164 void FrameView::removePart(LayoutPart* object) |
| 1165 { | 1165 { |
| 1166 m_parts.remove(object); | 1166 m_parts.remove(object); |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 void FrameView::updateWidgetPositions() | 1169 void FrameView::updateWidgetPositions() |
| 1170 { | 1170 { |
| 1171 Vector<RefPtr<RenderPart>> parts; | 1171 Vector<RefPtr<LayoutPart>> parts; |
| 1172 copyToVector(m_parts, parts); | 1172 copyToVector(m_parts, parts); |
| 1173 | 1173 |
| 1174 // Script or plugins could detach the frame so abort processing if that happ
ens. | 1174 // Script or plugins could detach the frame so abort processing if that happ
ens. |
| 1175 | 1175 |
| 1176 for (size_t i = 0; i < parts.size() && renderView(); ++i) | 1176 for (size_t i = 0; i < parts.size() && renderView(); ++i) |
| 1177 parts[i]->updateWidgetPosition(); | 1177 parts[i]->updateWidgetPosition(); |
| 1178 | 1178 |
| 1179 for (size_t i = 0; i < parts.size() && renderView(); ++i) | 1179 for (size_t i = 0; i < parts.size() && renderView(); ++i) |
| 1180 parts[i]->widgetPositionsUpdated(); | 1180 parts[i]->widgetPositionsUpdated(); |
| 1181 } | 1181 } |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 | 1394 |
| 1395 void FrameView::scrollContentsSlowPath(const IntRect& updateRect) | 1395 void FrameView::scrollContentsSlowPath(const IntRect& updateRect) |
| 1396 { | 1396 { |
| 1397 if (contentsInCompositedLayer()) { | 1397 if (contentsInCompositedLayer()) { |
| 1398 IntRect updateRect = visibleContentRect(); | 1398 IntRect updateRect = visibleContentRect(); |
| 1399 ASSERT(renderView()); | 1399 ASSERT(renderView()); |
| 1400 // FIXME: We should not allow paint invalidation out of paint invalidati
on state. crbug.com/457415 | 1400 // FIXME: We should not allow paint invalidation out of paint invalidati
on state. crbug.com/457415 |
| 1401 DisablePaintInvalidationStateAsserts disabler; | 1401 DisablePaintInvalidationStateAsserts disabler; |
| 1402 renderView()->invalidatePaintRectangle(updateRect); | 1402 renderView()->invalidatePaintRectangle(updateRect); |
| 1403 } | 1403 } |
| 1404 if (RenderPart* frameRenderer = m_frame->ownerRenderer()) { | 1404 if (LayoutPart* frameRenderer = m_frame->ownerRenderer()) { |
| 1405 if (isEnclosedInCompositingLayer()) { | 1405 if (isEnclosedInCompositingLayer()) { |
| 1406 // FIXME: This block is needed for the display list merge algorithm
to work correctly. | 1406 // FIXME: This block is needed for the display list merge algorithm
to work correctly. |
| 1407 // Remove this once https://codereview.chromium.org/847783003
/ lands. | 1407 // Remove this once https://codereview.chromium.org/847783003
/ lands. |
| 1408 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | 1408 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
| 1409 RenderView* renderView = this->renderView(); | 1409 RenderView* renderView = this->renderView(); |
| 1410 ASSERT(renderView); | 1410 ASSERT(renderView); |
| 1411 renderView->layer()->enclosingLayerForPaintInvalidationCrossingF
rameBoundaries()->graphicsLayerBacking()->displayItemList()->invalidate(renderVi
ew->displayItemClient()); | 1411 renderView->layer()->enclosingLayerForPaintInvalidationCrossingF
rameBoundaries()->graphicsLayerBacking()->displayItemList()->invalidate(renderVi
ew->displayItemClient()); |
| 1412 } | 1412 } |
| 1413 | 1413 |
| 1414 LayoutRect rect(frameRenderer->borderLeft() + frameRenderer->padding
Left(), | 1414 LayoutRect rect(frameRenderer->borderLeft() + frameRenderer->padding
Left(), |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2333 bool FrameView::scrollbarsCanBeActive() const | 2333 bool FrameView::scrollbarsCanBeActive() const |
| 2334 { | 2334 { |
| 2335 if (m_frame->view() != this) | 2335 if (m_frame->view() != this) |
| 2336 return false; | 2336 return false; |
| 2337 | 2337 |
| 2338 return !!m_frame->document(); | 2338 return !!m_frame->document(); |
| 2339 } | 2339 } |
| 2340 | 2340 |
| 2341 IntRect FrameView::scrollableAreaBoundingBox() const | 2341 IntRect FrameView::scrollableAreaBoundingBox() const |
| 2342 { | 2342 { |
| 2343 RenderPart* ownerRenderer = frame().ownerRenderer(); | 2343 LayoutPart* ownerRenderer = frame().ownerRenderer(); |
| 2344 if (!ownerRenderer) | 2344 if (!ownerRenderer) |
| 2345 return frameRect(); | 2345 return frameRect(); |
| 2346 | 2346 |
| 2347 return ownerRenderer->absoluteContentQuad().enclosingBoundingBox(); | 2347 return ownerRenderer->absoluteContentQuad().enclosingBoundingBox(); |
| 2348 } | 2348 } |
| 2349 | 2349 |
| 2350 | 2350 |
| 2351 bool FrameView::isScrollable() | 2351 bool FrameView::isScrollable() |
| 2352 { | 2352 { |
| 2353 return scrollingReasons() == Scrollable; | 2353 return scrollingReasons() == Scrollable; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2468 if (!cornerStyle) { | 2468 if (!cornerStyle) { |
| 2469 // If the <body> didn't have a custom style, then the root element m
ight. | 2469 // If the <body> didn't have a custom style, then the root element m
ight. |
| 2470 if (Element* docElement = doc->documentElement()) { | 2470 if (Element* docElement = doc->documentElement()) { |
| 2471 if (LayoutObject* renderer = docElement->renderer()) | 2471 if (LayoutObject* renderer = docElement->renderer()) |
| 2472 cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleRe
quest(SCROLLBAR_CORNER), renderer->style()); | 2472 cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleRe
quest(SCROLLBAR_CORNER), renderer->style()); |
| 2473 } | 2473 } |
| 2474 } | 2474 } |
| 2475 | 2475 |
| 2476 if (!cornerStyle) { | 2476 if (!cornerStyle) { |
| 2477 // If we have an owning ipage/LocalFrame element, then it can set th
e custom scrollbar also. | 2477 // If we have an owning ipage/LocalFrame element, then it can set th
e custom scrollbar also. |
| 2478 if (RenderPart* renderer = m_frame->ownerRenderer()) | 2478 if (LayoutPart* renderer = m_frame->ownerRenderer()) |
| 2479 cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleReques
t(SCROLLBAR_CORNER), renderer->style()); | 2479 cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleReques
t(SCROLLBAR_CORNER), renderer->style()); |
| 2480 } | 2480 } |
| 2481 } | 2481 } |
| 2482 | 2482 |
| 2483 if (cornerStyle) { | 2483 if (cornerStyle) { |
| 2484 if (!m_scrollCorner) | 2484 if (!m_scrollCorner) |
| 2485 m_scrollCorner = RenderScrollbarPart::createAnonymous(doc); | 2485 m_scrollCorner = RenderScrollbarPart::createAnonymous(doc); |
| 2486 m_scrollCorner->setStyle(cornerStyle.release()); | 2486 m_scrollCorner->setStyle(cornerStyle.release()); |
| 2487 invalidateScrollCorner(cornerRect); | 2487 invalidateScrollCorner(cornerRect); |
| 2488 } else if (m_scrollCorner) { | 2488 } else if (m_scrollCorner) { |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2789 // Convert from FrameView coords into page ("absolute") coordinates. | 2789 // Convert from FrameView coords into page ("absolute") coordinates. |
| 2790 point += IntSize(scrollX(), scrollY()); | 2790 point += IntSize(scrollX(), scrollY()); |
| 2791 | 2791 |
| 2792 return roundedIntPoint(renderer.absoluteToLocal(point, UseTransforms)); | 2792 return roundedIntPoint(renderer.absoluteToLocal(point, UseTransforms)); |
| 2793 } | 2793 } |
| 2794 | 2794 |
| 2795 IntRect FrameView::convertToContainingView(const IntRect& localRect) const | 2795 IntRect FrameView::convertToContainingView(const IntRect& localRect) const |
| 2796 { | 2796 { |
| 2797 if (const FrameView* parentView = toFrameView(parent())) { | 2797 if (const FrameView* parentView = toFrameView(parent())) { |
| 2798 // Get our renderer in the parent view | 2798 // Get our renderer in the parent view |
| 2799 RenderPart* renderer = m_frame->ownerRenderer(); | 2799 LayoutPart* renderer = m_frame->ownerRenderer(); |
| 2800 if (!renderer) | 2800 if (!renderer) |
| 2801 return localRect; | 2801 return localRect; |
| 2802 | 2802 |
| 2803 IntRect rect(localRect); | 2803 IntRect rect(localRect); |
| 2804 // Add borders and padding?? | 2804 // Add borders and padding?? |
| 2805 rect.move(renderer->borderLeft() + renderer->paddingLeft(), | 2805 rect.move(renderer->borderLeft() + renderer->paddingLeft(), |
| 2806 renderer->borderTop() + renderer->paddingTop()); | 2806 renderer->borderTop() + renderer->paddingTop()); |
| 2807 return parentView->convertFromRenderer(*renderer, rect); | 2807 return parentView->convertFromRenderer(*renderer, rect); |
| 2808 } | 2808 } |
| 2809 | 2809 |
| 2810 return localRect; | 2810 return localRect; |
| 2811 } | 2811 } |
| 2812 | 2812 |
| 2813 IntRect FrameView::convertFromContainingView(const IntRect& parentRect) const | 2813 IntRect FrameView::convertFromContainingView(const IntRect& parentRect) const |
| 2814 { | 2814 { |
| 2815 if (const FrameView* parentView = toFrameView(parent())) { | 2815 if (const FrameView* parentView = toFrameView(parent())) { |
| 2816 // Get our renderer in the parent view | 2816 // Get our renderer in the parent view |
| 2817 RenderPart* renderer = m_frame->ownerRenderer(); | 2817 LayoutPart* renderer = m_frame->ownerRenderer(); |
| 2818 if (!renderer) | 2818 if (!renderer) |
| 2819 return parentRect; | 2819 return parentRect; |
| 2820 | 2820 |
| 2821 IntRect rect = parentView->convertToRenderer(*renderer, parentRect); | 2821 IntRect rect = parentView->convertToRenderer(*renderer, parentRect); |
| 2822 // Subtract borders and padding | 2822 // Subtract borders and padding |
| 2823 rect.move(-renderer->borderLeft() - renderer->paddingLeft(), | 2823 rect.move(-renderer->borderLeft() - renderer->paddingLeft(), |
| 2824 -renderer->borderTop() - renderer->paddingTop()); | 2824 -renderer->borderTop() - renderer->paddingTop()); |
| 2825 return rect; | 2825 return rect; |
| 2826 } | 2826 } |
| 2827 | 2827 |
| 2828 return parentRect; | 2828 return parentRect; |
| 2829 } | 2829 } |
| 2830 | 2830 |
| 2831 IntPoint FrameView::convertToContainingView(const IntPoint& localPoint) const | 2831 IntPoint FrameView::convertToContainingView(const IntPoint& localPoint) const |
| 2832 { | 2832 { |
| 2833 if (const FrameView* parentView = toFrameView(parent())) { | 2833 if (const FrameView* parentView = toFrameView(parent())) { |
| 2834 // Get our renderer in the parent view | 2834 // Get our renderer in the parent view |
| 2835 RenderPart* renderer = m_frame->ownerRenderer(); | 2835 LayoutPart* renderer = m_frame->ownerRenderer(); |
| 2836 if (!renderer) | 2836 if (!renderer) |
| 2837 return localPoint; | 2837 return localPoint; |
| 2838 | 2838 |
| 2839 IntPoint point(localPoint); | 2839 IntPoint point(localPoint); |
| 2840 | 2840 |
| 2841 // Add borders and padding | 2841 // Add borders and padding |
| 2842 point.move(renderer->borderLeft() + renderer->paddingLeft(), | 2842 point.move(renderer->borderLeft() + renderer->paddingLeft(), |
| 2843 renderer->borderTop() + renderer->paddingTop()); | 2843 renderer->borderTop() + renderer->paddingTop()); |
| 2844 return parentView->convertFromRenderer(*renderer, point); | 2844 return parentView->convertFromRenderer(*renderer, point); |
| 2845 } | 2845 } |
| 2846 | 2846 |
| 2847 return localPoint; | 2847 return localPoint; |
| 2848 } | 2848 } |
| 2849 | 2849 |
| 2850 IntPoint FrameView::convertFromContainingView(const IntPoint& parentPoint) const | 2850 IntPoint FrameView::convertFromContainingView(const IntPoint& parentPoint) const |
| 2851 { | 2851 { |
| 2852 if (const FrameView* parentView = toFrameView(parent())) { | 2852 if (const FrameView* parentView = toFrameView(parent())) { |
| 2853 // Get our renderer in the parent view | 2853 // Get our renderer in the parent view |
| 2854 RenderPart* renderer = m_frame->ownerRenderer(); | 2854 LayoutPart* renderer = m_frame->ownerRenderer(); |
| 2855 if (!renderer) | 2855 if (!renderer) |
| 2856 return parentPoint; | 2856 return parentPoint; |
| 2857 | 2857 |
| 2858 IntPoint point = parentView->convertToRenderer(*renderer, parentPoint); | 2858 IntPoint point = parentView->convertToRenderer(*renderer, parentPoint); |
| 2859 // Subtract borders and padding | 2859 // Subtract borders and padding |
| 2860 point.move(-renderer->borderLeft() - renderer->paddingLeft(), | 2860 point.move(-renderer->borderLeft() - renderer->paddingLeft(), |
| 2861 -renderer->borderTop() - renderer->paddingTop()); | 2861 -renderer->borderTop() - renderer->paddingTop()); |
| 2862 return point; | 2862 return point; |
| 2863 } | 2863 } |
| 2864 | 2864 |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4051 { | 4051 { |
| 4052 Settings* settings = frame().settings(); | 4052 Settings* settings = frame().settings(); |
| 4053 if (!settings || !settings->rootLayerScrolls()) | 4053 if (!settings || !settings->rootLayerScrolls()) |
| 4054 return this; | 4054 return this; |
| 4055 | 4055 |
| 4056 RenderView* renderView = this->renderView(); | 4056 RenderView* renderView = this->renderView(); |
| 4057 return renderView ? renderView->scrollableArea() : nullptr; | 4057 return renderView ? renderView->scrollableArea() : nullptr; |
| 4058 } | 4058 } |
| 4059 | 4059 |
| 4060 } // namespace blink | 4060 } // namespace blink |
| OLD | NEW |