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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 if (Settings* settings = m_frame->settings()) { | 477 if (Settings* settings = m_frame->settings()) { |
478 if (!settings->allowCustomScrollbarInMainFrame() && m_frame->isMainFrame
()) | 478 if (!settings->allowCustomScrollbarInMainFrame() && m_frame->isMainFrame
()) |
479 return false; | 479 return false; |
480 } | 480 } |
481 | 481 |
482 // FIXME: We need to update the scrollbar dynamically as documents change (o
r as doc elements and bodies get discovered that have custom styles). | 482 // FIXME: We need to update the scrollbar dynamically as documents change (o
r as doc elements and bodies get discovered that have custom styles). |
483 Document* doc = m_frame->document(); | 483 Document* doc = m_frame->document(); |
484 | 484 |
485 // Try the <body> element first as a scrollbar source. | 485 // Try the <body> element first as a scrollbar source. |
486 Element* body = doc ? doc->body() : 0; | 486 Element* body = doc ? doc->body() : 0; |
487 if (body && body->renderer() && body->renderer()->style()->hasPseudoStyle(SC
ROLLBAR)) { | 487 if (body && body->layoutObject() && body->layoutObject()->style()->hasPseudo
Style(SCROLLBAR)) { |
488 customScrollbarElement = body; | 488 customScrollbarElement = body; |
489 return true; | 489 return true; |
490 } | 490 } |
491 | 491 |
492 // If the <body> didn't have a custom style, then the root element might. | 492 // If the <body> didn't have a custom style, then the root element might. |
493 Element* docElement = doc ? doc->documentElement() : 0; | 493 Element* docElement = doc ? doc->documentElement() : 0; |
494 if (docElement && docElement->renderer() && docElement->renderer()->style()-
>hasPseudoStyle(SCROLLBAR)) { | 494 if (docElement && docElement->layoutObject() && docElement->layoutObject()->
style()->hasPseudoStyle(SCROLLBAR)) { |
495 customScrollbarElement = docElement; | 495 customScrollbarElement = docElement; |
496 return true; | 496 return true; |
497 } | 497 } |
498 | 498 |
499 // If we have an owning ipage/LocalFrame element, then it can set the custom
scrollbar also. | 499 // If we have an owning ipage/LocalFrame element, then it can set the custom
scrollbar also. |
500 LayoutPart* frameLayoutObject = m_frame->ownerLayoutObject(); | 500 LayoutPart* frameLayoutObject = m_frame->ownerLayoutObject(); |
501 if (frameLayoutObject && frameLayoutObject->style()->hasPseudoStyle(SCROLLBA
R)) { | 501 if (frameLayoutObject && frameLayoutObject->style()->hasPseudoStyle(SCROLLBA
R)) { |
502 customScrollbarFrame = m_frame.get(); | 502 customScrollbarFrame = m_frame.get(); |
503 return true; | 503 return true; |
504 } | 504 } |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 hMode = ScrollbarAuto; | 639 hMode = ScrollbarAuto; |
640 vMode = ScrollbarAuto; | 640 vMode = ScrollbarAuto; |
641 } else { | 641 } else { |
642 hMode = ScrollbarAlwaysOff; | 642 hMode = ScrollbarAlwaysOff; |
643 vMode = ScrollbarAlwaysOff; | 643 vMode = ScrollbarAlwaysOff; |
644 } | 644 } |
645 | 645 |
646 if (!isSubtreeLayout()) { | 646 if (!isSubtreeLayout()) { |
647 Document* document = m_frame->document(); | 647 Document* document = m_frame->document(); |
648 Node* body = document->body(); | 648 Node* body = document->body(); |
649 if (isHTMLFrameSetElement(body) && body->renderer()) { | 649 if (isHTMLFrameSetElement(body) && body->layoutObject()) { |
650 vMode = ScrollbarAlwaysOff; | 650 vMode = ScrollbarAlwaysOff; |
651 hMode = ScrollbarAlwaysOff; | 651 hMode = ScrollbarAlwaysOff; |
652 } else if (Element* viewportElement = document->viewportDefiningElement(
)) { | 652 } else if (Element* viewportElement = document->viewportDefiningElement(
)) { |
653 if (LayoutObject* viewportRenderer = viewportElement->renderer()) { | 653 if (LayoutObject* viewportRenderer = viewportElement->layoutObject()
) { |
654 if (viewportRenderer->style()) | 654 if (viewportRenderer->style()) |
655 applyOverflowToViewportAndSetRenderer(viewportRenderer, hMod
e, vMode); | 655 applyOverflowToViewportAndSetRenderer(viewportRenderer, hMod
e, vMode); |
656 } | 656 } |
657 } | 657 } |
658 } | 658 } |
659 } | 659 } |
660 | 660 |
661 void FrameView::updateAcceleratedCompositingSettings() | 661 void FrameView::updateAcceleratedCompositingSettings() |
662 { | 662 { |
663 if (LayoutView* layoutView = this->layoutView()) | 663 if (LayoutView* layoutView = this->layoutView()) |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 } | 986 } |
987 | 987 |
988 FontCachePurgePreventer fontCachePurgePreventer; | 988 FontCachePurgePreventer fontCachePurgePreventer; |
989 { | 989 { |
990 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled,
false); | 990 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled,
false); |
991 | 991 |
992 m_nestedLayoutCount++; | 992 m_nestedLayoutCount++; |
993 if (!inSubtreeLayout) { | 993 if (!inSubtreeLayout) { |
994 clearLayoutSubtreeRootsAndMarkContainingBlocks(); | 994 clearLayoutSubtreeRootsAndMarkContainingBlocks(); |
995 Node* body = document->body(); | 995 Node* body = document->body(); |
996 if (body && body->renderer()) { | 996 if (body && body->layoutObject()) { |
997 if (isHTMLFrameSetElement(*body)) { | 997 if (isHTMLFrameSetElement(*body)) { |
998 body->renderer()->setChildNeedsLayout(); | 998 body->layoutObject()->setChildNeedsLayout(); |
999 } else if (isHTMLBodyElement(*body)) { | 999 } else if (isHTMLBodyElement(*body)) { |
1000 if (!m_firstLayout && m_size.height() != layoutSize().height
() && body->renderer()->enclosingBox()->stretchesToViewport()) | 1000 if (!m_firstLayout && m_size.height() != layoutSize().height
() && body->layoutObject()->enclosingBox()->stretchesToViewport()) |
1001 body->renderer()->setChildNeedsLayout(); | 1001 body->layoutObject()->setChildNeedsLayout(); |
1002 } | 1002 } |
1003 } | 1003 } |
1004 } | 1004 } |
1005 updateCounters(); | 1005 updateCounters(); |
1006 | 1006 |
1007 ScrollbarMode hMode; | 1007 ScrollbarMode hMode; |
1008 ScrollbarMode vMode; | 1008 ScrollbarMode vMode; |
1009 calculateScrollbarModesForLayoutAndSetViewportRenderer(hMode, vMode); | 1009 calculateScrollbarModesForLayoutAndSetViewportRenderer(hMode, vMode); |
1010 | 1010 |
1011 if (!inSubtreeLayout) { | 1011 if (!inSubtreeLayout) { |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 if (!child->isLocalFrame()) | 1348 if (!child->isLocalFrame()) |
1349 continue; | 1349 continue; |
1350 if (FrameView* view = toLocalFrame(child)->view()) | 1350 if (FrameView* view = toLocalFrame(child)->view()) |
1351 view->scrollContentsIfNeededRecursive(); | 1351 view->scrollContentsIfNeededRecursive(); |
1352 } | 1352 } |
1353 } | 1353 } |
1354 | 1354 |
1355 // FIXME: If we had a flag to force invalidations in a whole subtree, we could g
et rid of this function (crbug.com/410097). | 1355 // FIXME: If we had a flag to force invalidations in a whole subtree, we could g
et rid of this function (crbug.com/410097). |
1356 static void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(c
onst Layer* layer) | 1356 static void setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(c
onst Layer* layer) |
1357 { | 1357 { |
1358 layer->renderer()->setShouldDoFullPaintInvalidation(); | 1358 layer->layoutObject()->setShouldDoFullPaintInvalidation(); |
1359 | 1359 |
1360 for (Layer* child = layer->firstChild(); child; child = child->nextSibling()
) { | 1360 for (Layer* child = layer->firstChild(); child; child = child->nextSibling()
) { |
1361 // Don't include paint invalidation rects for composited child layers; t
hey will paint themselves and have a different origin. | 1361 // Don't include paint invalidation rects for composited child layers; t
hey will paint themselves and have a different origin. |
1362 if (child->isPaintInvalidationContainer()) | 1362 if (child->isPaintInvalidationContainer()) |
1363 continue; | 1363 continue; |
1364 | 1364 |
1365 setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(child
); | 1365 setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants(child
); |
1366 } | 1366 } |
1367 } | 1367 } |
1368 | 1368 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1539 cancelProgrammaticScrollAnimation(); | 1539 cancelProgrammaticScrollAnimation(); |
1540 TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, tru
e); | 1540 TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, tru
e); |
1541 m_maintainScrollPositionAnchor = nullptr; | 1541 m_maintainScrollPositionAnchor = nullptr; |
1542 | 1542 |
1543 DoublePoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint)
; | 1543 DoublePoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint)
; |
1544 if (newScrollPosition == scrollPositionDouble()) | 1544 if (newScrollPosition == scrollPositionDouble()) |
1545 return; | 1545 return; |
1546 | 1546 |
1547 if (scrollBehavior == ScrollBehaviorAuto) { | 1547 if (scrollBehavior == ScrollBehaviorAuto) { |
1548 Element* scrollElement = RuntimeEnabledFeatures::scrollTopLeftInteropEna
bled() ? m_frame->document()->documentElement() : m_frame->document()->body(); | 1548 Element* scrollElement = RuntimeEnabledFeatures::scrollTopLeftInteropEna
bled() ? m_frame->document()->documentElement() : m_frame->document()->body(); |
1549 LayoutObject* renderer = scrollElement ? scrollElement->renderer() : nul
lptr; | 1549 LayoutObject* renderer = scrollElement ? scrollElement->layoutObject() :
nullptr; |
1550 if (renderer && renderer->style()->scrollBehavior() == ScrollBehaviorSmo
oth) | 1550 if (renderer && renderer->style()->scrollBehavior() == ScrollBehaviorSmo
oth) |
1551 scrollBehavior = ScrollBehaviorSmooth; | 1551 scrollBehavior = ScrollBehaviorSmooth; |
1552 else | 1552 else |
1553 scrollBehavior = ScrollBehaviorInstant; | 1553 scrollBehavior = ScrollBehaviorInstant; |
1554 } | 1554 } |
1555 | 1555 |
1556 if (scrollBehavior == ScrollBehaviorInstant) { | 1556 if (scrollBehavior == ScrollBehaviorInstant) { |
1557 DoubleSize newOffset(newScrollPosition.x(), newScrollPosition.y()); | 1557 DoubleSize newOffset(newScrollPosition.x(), newScrollPosition.y()); |
1558 updateScrollbars(newOffset); | 1558 updateScrollbars(newOffset); |
1559 } else { | 1559 } else { |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1924 } | 1924 } |
1925 } | 1925 } |
1926 } | 1926 } |
1927 | 1927 |
1928 void FrameView::scrollToAnchor() | 1928 void FrameView::scrollToAnchor() |
1929 { | 1929 { |
1930 RefPtrWillBeRawPtr<Node> anchorNode = m_maintainScrollPositionAnchor; | 1930 RefPtrWillBeRawPtr<Node> anchorNode = m_maintainScrollPositionAnchor; |
1931 if (!anchorNode) | 1931 if (!anchorNode) |
1932 return; | 1932 return; |
1933 | 1933 |
1934 if (!anchorNode->renderer()) | 1934 if (!anchorNode->layoutObject()) |
1935 return; | 1935 return; |
1936 | 1936 |
1937 LayoutRect rect; | 1937 LayoutRect rect; |
1938 if (anchorNode != m_frame->document()) | 1938 if (anchorNode != m_frame->document()) |
1939 rect = anchorNode->boundingBox(); | 1939 rect = anchorNode->boundingBox(); |
1940 | 1940 |
1941 RefPtrWillBeRawPtr<Frame> boundaryFrame = m_frame->findUnsafeParentScrollPro
pagationBoundary(); | 1941 RefPtrWillBeRawPtr<Frame> boundaryFrame = m_frame->findUnsafeParentScrollPro
pagationBoundary(); |
1942 | 1942 |
1943 // FIXME: Handle RemoteFrames | 1943 // FIXME: Handle RemoteFrames |
1944 if (boundaryFrame && boundaryFrame->isLocalFrame()) | 1944 if (boundaryFrame && boundaryFrame->isLocalFrame()) |
1945 toLocalFrame(boundaryFrame.get())->view()->setSafeToPropagateScrollToPar
ent(false); | 1945 toLocalFrame(boundaryFrame.get())->view()->setSafeToPropagateScrollToPar
ent(false); |
1946 | 1946 |
1947 // Scroll nested layers and frames to reveal the anchor. | 1947 // Scroll nested layers and frames to reveal the anchor. |
1948 // Align to the top and to the closest side (this matches other browsers). | 1948 // Align to the top and to the closest side (this matches other browsers). |
1949 anchorNode->renderer()->scrollRectToVisible(rect, ScrollAlignment::alignToEd
geIfNeeded, ScrollAlignment::alignTopAlways); | 1949 anchorNode->layoutObject()->scrollRectToVisible(rect, ScrollAlignment::align
ToEdgeIfNeeded, ScrollAlignment::alignTopAlways); |
1950 | 1950 |
1951 if (boundaryFrame && boundaryFrame->isLocalFrame()) | 1951 if (boundaryFrame && boundaryFrame->isLocalFrame()) |
1952 toLocalFrame(boundaryFrame.get())->view()->setSafeToPropagateScrollToPar
ent(true); | 1952 toLocalFrame(boundaryFrame.get())->view()->setSafeToPropagateScrollToPar
ent(true); |
1953 | 1953 |
1954 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) | 1954 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) |
1955 cache->handleScrolledToAnchor(anchorNode.get()); | 1955 cache->handleScrolledToAnchor(anchorNode.get()); |
1956 | 1956 |
1957 // scrollRectToVisible can call into setScrollPosition(), which resets m_mai
ntainScrollPositionAnchor. | 1957 // scrollRectToVisible can call into setScrollPosition(), which resets m_mai
ntainScrollPositionAnchor. |
1958 m_maintainScrollPositionAnchor = anchorNode; | 1958 m_maintainScrollPositionAnchor = anchorNode; |
1959 } | 1959 } |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2167 FrameView* parentView = ownerElement->document().view(); | 2167 FrameView* parentView = ownerElement->document().view(); |
2168 if (parentView) | 2168 if (parentView) |
2169 clipRect.intersect(parentView->windowClipRectForFrameOwner(ownerElement)
); | 2169 clipRect.intersect(parentView->windowClipRectForFrameOwner(ownerElement)
); |
2170 return clipRect; | 2170 return clipRect; |
2171 } | 2171 } |
2172 | 2172 |
2173 IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* owne
rElement) const | 2173 IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* owne
rElement) const |
2174 { | 2174 { |
2175 // The renderer can sometimes be null when style="display:none" interacts | 2175 // The renderer can sometimes be null when style="display:none" interacts |
2176 // with external content and plugins. | 2176 // with external content and plugins. |
2177 if (!ownerElement->renderer()) | 2177 if (!ownerElement->layoutObject()) |
2178 return windowClipRect(); | 2178 return windowClipRect(); |
2179 | 2179 |
2180 // If we have no layer, just return our window clip rect. | 2180 // If we have no layer, just return our window clip rect. |
2181 const Layer* enclosingLayer = ownerElement->renderer()->enclosingLayer(); | 2181 const Layer* enclosingLayer = ownerElement->layoutObject()->enclosingLayer()
; |
2182 if (!enclosingLayer) | 2182 if (!enclosingLayer) |
2183 return windowClipRect(); | 2183 return windowClipRect(); |
2184 | 2184 |
2185 // FIXME: childrenClipRect relies on compositingState, which is not necessar
ily up to date. | 2185 // FIXME: childrenClipRect relies on compositingState, which is not necessar
ily up to date. |
2186 // https://code.google.com/p/chromium/issues/detail?id=343769 | 2186 // https://code.google.com/p/chromium/issues/detail?id=343769 |
2187 DisableCompositingQueryAsserts disabler; | 2187 DisableCompositingQueryAsserts disabler; |
2188 | 2188 |
2189 // Apply the clip from the layer. | 2189 // Apply the clip from the layer. |
2190 IntRect clipRect = contentsToWindow(pixelSnappedIntRect(enclosingLayer->clip
per().childrenClipRect())); | 2190 IntRect clipRect = contentsToWindow(pixelSnappedIntRect(enclosingLayer->clip
per().childrenClipRect())); |
2191 return intersection(clipRect, windowClipRect()); | 2191 return intersection(clipRect, windowClipRect()); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2317 | 2317 |
2318 // Covers #1 | 2318 // Covers #1 |
2319 IntSize contentsSize = this->contentsSize(); | 2319 IntSize contentsSize = this->contentsSize(); |
2320 IntSize visibleContentSize = visibleContentRect().size(); | 2320 IntSize visibleContentSize = visibleContentRect().size(); |
2321 if ((contentsSize.height() <= visibleContentSize.height() && contentsSize.wi
dth() <= visibleContentSize.width())) | 2321 if ((contentsSize.height() <= visibleContentSize.height() && contentsSize.wi
dth() <= visibleContentSize.width())) |
2322 return NotScrollableNoOverflow; | 2322 return NotScrollableNoOverflow; |
2323 | 2323 |
2324 // Covers #2. | 2324 // Covers #2. |
2325 // FIXME: Do we need to fix this for OOPI? | 2325 // FIXME: Do we need to fix this for OOPI? |
2326 HTMLFrameOwnerElement* owner = m_frame->deprecatedLocalOwner(); | 2326 HTMLFrameOwnerElement* owner = m_frame->deprecatedLocalOwner(); |
2327 if (owner && (!owner->renderer() || !owner->renderer()->visibleToHitTesting(
))) | 2327 if (owner && (!owner->layoutObject() || !owner->layoutObject()->visibleToHit
Testing())) |
2328 return NotScrollableNotVisible; | 2328 return NotScrollableNotVisible; |
2329 | 2329 |
2330 // Cover #3 and #4. | 2330 // Cover #3 and #4. |
2331 ScrollbarMode horizontalMode; | 2331 ScrollbarMode horizontalMode; |
2332 ScrollbarMode verticalMode; | 2332 ScrollbarMode verticalMode; |
2333 calculateScrollbarModesForLayoutAndSetViewportRenderer(horizontalMode, verti
calMode, RulesFromWebContentOnly); | 2333 calculateScrollbarModesForLayoutAndSetViewportRenderer(horizontalMode, verti
calMode, RulesFromWebContentOnly); |
2334 if (horizontalMode == ScrollbarAlwaysOff && verticalMode == ScrollbarAlwaysO
ff) | 2334 if (horizontalMode == ScrollbarAlwaysOff && verticalMode == ScrollbarAlwaysO
ff) |
2335 return NotScrollableExplicitlyDisabled; | 2335 return NotScrollableExplicitlyDisabled; |
2336 | 2336 |
2337 return Scrollable; | 2337 return Scrollable; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2408 | 2408 |
2409 void FrameView::updateScrollCorner() | 2409 void FrameView::updateScrollCorner() |
2410 { | 2410 { |
2411 RefPtr<LayoutStyle> cornerStyle; | 2411 RefPtr<LayoutStyle> cornerStyle; |
2412 IntRect cornerRect = scrollCornerRect(); | 2412 IntRect cornerRect = scrollCornerRect(); |
2413 Document* doc = m_frame->document(); | 2413 Document* doc = m_frame->document(); |
2414 | 2414 |
2415 if (doc && !cornerRect.isEmpty()) { | 2415 if (doc && !cornerRect.isEmpty()) { |
2416 // Try the <body> element first as a scroll corner source. | 2416 // Try the <body> element first as a scroll corner source. |
2417 if (Element* body = doc->body()) { | 2417 if (Element* body = doc->body()) { |
2418 if (LayoutObject* renderer = body->renderer()) | 2418 if (LayoutObject* renderer = body->layoutObject()) |
2419 cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleReques
t(SCROLLBAR_CORNER), renderer->style()); | 2419 cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleReques
t(SCROLLBAR_CORNER), renderer->style()); |
2420 } | 2420 } |
2421 | 2421 |
2422 if (!cornerStyle) { | 2422 if (!cornerStyle) { |
2423 // If the <body> didn't have a custom style, then the root element m
ight. | 2423 // If the <body> didn't have a custom style, then the root element m
ight. |
2424 if (Element* docElement = doc->documentElement()) { | 2424 if (Element* docElement = doc->documentElement()) { |
2425 if (LayoutObject* renderer = docElement->renderer()) | 2425 if (LayoutObject* renderer = docElement->layoutObject()) |
2426 cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleRe
quest(SCROLLBAR_CORNER), renderer->style()); | 2426 cornerStyle = renderer->getUncachedPseudoStyle(PseudoStyleRe
quest(SCROLLBAR_CORNER), renderer->style()); |
2427 } | 2427 } |
2428 } | 2428 } |
2429 | 2429 |
2430 if (!cornerStyle) { | 2430 if (!cornerStyle) { |
2431 // If we have an owning ipage/LocalFrame element, then it can set th
e custom scrollbar also. | 2431 // If we have an owning ipage/LocalFrame element, then it can set th
e custom scrollbar also. |
2432 if (LayoutPart* layoutObject = m_frame->ownerLayoutObject()) | 2432 if (LayoutPart* layoutObject = m_frame->ownerLayoutObject()) |
2433 cornerStyle = layoutObject->getUncachedPseudoStyle(PseudoStyleRe
quest(SCROLLBAR_CORNER), layoutObject->style()); | 2433 cornerStyle = layoutObject->getUncachedPseudoStyle(PseudoStyleRe
quest(SCROLLBAR_CORNER), layoutObject->style()); |
2434 } | 2434 } |
2435 } | 2435 } |
(...skipping 22 matching lines...) Expand all Loading... |
2458 Element* htmlElement = frame().document()->documentElement(); | 2458 Element* htmlElement = frame().document()->documentElement(); |
2459 Element* bodyElement = frame().document()->body(); | 2459 Element* bodyElement = frame().document()->body(); |
2460 | 2460 |
2461 // We take the aggregate of the base background color | 2461 // We take the aggregate of the base background color |
2462 // the <html> background color, and the <body> | 2462 // the <html> background color, and the <body> |
2463 // background color to find the document color. The | 2463 // background color to find the document color. The |
2464 // addition of the base background color is not | 2464 // addition of the base background color is not |
2465 // technically part of the document background, but it | 2465 // technically part of the document background, but it |
2466 // otherwise poses problems when the aggregate is not | 2466 // otherwise poses problems when the aggregate is not |
2467 // fully opaque. | 2467 // fully opaque. |
2468 if (htmlElement && htmlElement->renderer()) | 2468 if (htmlElement && htmlElement->layoutObject()) |
2469 result = result.blend(htmlElement->renderer()->resolveColor(CSSPropertyB
ackgroundColor)); | 2469 result = result.blend(htmlElement->layoutObject()->resolveColor(CSSPrope
rtyBackgroundColor)); |
2470 if (bodyElement && bodyElement->renderer()) | 2470 if (bodyElement && bodyElement->layoutObject()) |
2471 result = result.blend(bodyElement->renderer()->resolveColor(CSSPropertyB
ackgroundColor)); | 2471 result = result.blend(bodyElement->layoutObject()->resolveColor(CSSPrope
rtyBackgroundColor)); |
2472 | 2472 |
2473 return result; | 2473 return result; |
2474 } | 2474 } |
2475 | 2475 |
2476 FrameView* FrameView::parentFrameView() const | 2476 FrameView* FrameView::parentFrameView() const |
2477 { | 2477 { |
2478 if (!parent()) | 2478 if (!parent()) |
2479 return nullptr; | 2479 return nullptr; |
2480 | 2480 |
2481 Frame* parentFrame = m_frame->tree().parent(); | 2481 Frame* parentFrame = m_frame->tree().parent(); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2645 | 2645 |
2646 // Since autosize mode forces the scrollbar mode, change them to being auto. | 2646 // Since autosize mode forces the scrollbar mode, change them to being auto. |
2647 setVerticalScrollbarLock(false); | 2647 setVerticalScrollbarLock(false); |
2648 setHorizontalScrollbarLock(false); | 2648 setHorizontalScrollbarLock(false); |
2649 setScrollbarModes(ScrollbarAuto, ScrollbarAuto); | 2649 setScrollbarModes(ScrollbarAuto, ScrollbarAuto); |
2650 m_autoSizeInfo.clear(); | 2650 m_autoSizeInfo.clear(); |
2651 } | 2651 } |
2652 | 2652 |
2653 void FrameView::forceLayoutForPagination(const FloatSize& pageSize, const FloatS
ize& originalPageSize, float maximumShrinkFactor) | 2653 void FrameView::forceLayoutForPagination(const FloatSize& pageSize, const FloatS
ize& originalPageSize, float maximumShrinkFactor) |
2654 { | 2654 { |
2655 // Dumping externalRepresentation(m_frame->renderer()).ascii() is a good tri
ck to see | 2655 // Dumping externalRepresentation(m_frame->layoutObject()).ascii() is a good
trick to see |
2656 // the state of things before and after the layout | 2656 // the state of things before and after the layout |
2657 if (LayoutView* layoutView = this->layoutView()) { | 2657 if (LayoutView* layoutView = this->layoutView()) { |
2658 float pageLogicalWidth = layoutView->style()->isHorizontalWritingMode()
? pageSize.width() : pageSize.height(); | 2658 float pageLogicalWidth = layoutView->style()->isHorizontalWritingMode()
? pageSize.width() : pageSize.height(); |
2659 float pageLogicalHeight = layoutView->style()->isHorizontalWritingMode()
? pageSize.height() : pageSize.width(); | 2659 float pageLogicalHeight = layoutView->style()->isHorizontalWritingMode()
? pageSize.height() : pageSize.width(); |
2660 | 2660 |
2661 LayoutUnit flooredPageLogicalWidth = static_cast<LayoutUnit>(pageLogical
Width); | 2661 LayoutUnit flooredPageLogicalWidth = static_cast<LayoutUnit>(pageLogical
Width); |
2662 LayoutUnit flooredPageLogicalHeight = static_cast<LayoutUnit>(pageLogica
lHeight); | 2662 LayoutUnit flooredPageLogicalHeight = static_cast<LayoutUnit>(pageLogica
lHeight); |
2663 layoutView->setLogicalWidth(flooredPageLogicalWidth); | 2663 layoutView->setLogicalWidth(flooredPageLogicalWidth); |
2664 layoutView->setPageLogicalHeight(flooredPageLogicalHeight); | 2664 layoutView->setPageLogicalHeight(flooredPageLogicalHeight); |
2665 layoutView->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); | 2665 layoutView->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); |
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4038 { | 4038 { |
4039 Settings* settings = frame().settings(); | 4039 Settings* settings = frame().settings(); |
4040 if (!settings || !settings->rootLayerScrolls()) | 4040 if (!settings || !settings->rootLayerScrolls()) |
4041 return this; | 4041 return this; |
4042 | 4042 |
4043 LayoutView* layoutView = this->layoutView(); | 4043 LayoutView* layoutView = this->layoutView(); |
4044 return layoutView ? layoutView->scrollableArea() : nullptr; | 4044 return layoutView ? layoutView->scrollableArea() : nullptr; |
4045 } | 4045 } |
4046 | 4046 |
4047 } // namespace blink | 4047 } // namespace blink |
OLD | NEW |