Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: Source/WebCore/rendering/RenderLayer.cpp

Issue 12084049: Merge 140202 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | Source/WebCore/rendering/RenderObject.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 if (renderer()->parent()) { 2088 if (renderer()->parent()) {
2089 parentLayer = renderer()->parent()->enclosingLayer(); 2089 parentLayer = renderer()->parent()->enclosingLayer();
2090 restrictedByLineClamp = !renderer()->parent()->style()->lineClamp().isNo ne(); 2090 restrictedByLineClamp = !renderer()->parent()->style()->lineClamp().isNo ne();
2091 } 2091 }
2092 2092
2093 if (renderer()->hasOverflowClip() && !restrictedByLineClamp) { 2093 if (renderer()->hasOverflowClip() && !restrictedByLineClamp) {
2094 // Don't scroll to reveal an overflow layer that is restricted by the -w ebkit-line-clamp property. 2094 // Don't scroll to reveal an overflow layer that is restricted by the -w ebkit-line-clamp property.
2095 // This will prevent us from revealing text hidden by the slider in Safa ri RSS. 2095 // This will prevent us from revealing text hidden by the slider in Safa ri RSS.
2096 RenderBox* box = renderBox(); 2096 RenderBox* box = renderBox();
2097 ASSERT(box); 2097 ASSERT(box);
2098 FloatPoint absPos = box->localToAbsolute(); 2098 LayoutRect localExposeRect(box->absoluteToLocalQuad(FloatQuad(FloatRect( rect)), UseTransforms).boundingBox());
2099 absPos.move(box->borderLeft(), box->borderTop()); 2099 LayoutRect layerBounds(0, 0, box->clientWidth(), box->clientHeight());
2100 LayoutRect r = getRectToExpose(layerBounds, localExposeRect, alignX, ali gnY);
2100 2101
2101 LayoutRect layerBounds = LayoutRect(absPos.x() + scrollXOffset(), absPos .y() + scrollYOffset(), box->clientWidth(), box->clientHeight()); 2102 IntSize clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSi ze(roundedIntRect(r).location()));
2102 LayoutRect exposeRect = LayoutRect(rect.x() + scrollXOffset(), rect.y() + scrollYOffset(), rect.width(), rect.height());
2103 LayoutRect r = getRectToExpose(layerBounds, exposeRect, alignX, alignY);
2104
2105 int roundedAdjustedX = roundToInt(r.x() - absPos.x());
2106 int roundedAdjustedY = roundToInt(r.y() - absPos.y());
2107 IntSize clampedScrollOffset = clampScrollOffset(IntSize(roundedAdjustedX , roundedAdjustedY));
2108 if (clampedScrollOffset != scrollOffset()) { 2103 if (clampedScrollOffset != scrollOffset()) {
2109 IntSize oldScrollOffset = scrollOffset(); 2104 IntSize oldScrollOffset = scrollOffset();
2110 scrollToOffset(clampedScrollOffset); 2105 scrollToOffset(clampedScrollOffset);
2111 IntSize scrollOffsetDifference = scrollOffset() - oldScrollOffset; 2106 IntSize scrollOffsetDifference = scrollOffset() - oldScrollOffset;
2112 newRect.move(-scrollOffsetDifference); 2107 localExposeRect.move(-scrollOffsetDifference);
2108 newRect = LayoutRect(box->localToAbsoluteQuad(FloatQuad(FloatRect(lo calExposeRect)), UseTransforms).boundingBox());
2113 } 2109 }
2114 } else if (!parentLayer && renderer()->isBox() && renderBox()->canBePrograma ticallyScrolled()) { 2110 } else if (!parentLayer && renderer()->isBox() && renderBox()->canBePrograma ticallyScrolled()) {
2115 if (frameView) { 2111 if (frameView) {
2116 Element* ownerElement = 0; 2112 Element* ownerElement = 0;
2117 if (renderer()->document()) 2113 if (renderer()->document())
2118 ownerElement = renderer()->document()->ownerElement(); 2114 ownerElement = renderer()->document()->ownerElement();
2119 2115
2120 if (ownerElement && ownerElement->renderer()) { 2116 if (ownerElement && ownerElement->renderer()) {
2121 HTMLFrameElement* frameElement = 0; 2117 HTMLFrameElement* frameElement = 0;
2122 2118
2123 if (ownerElement->hasTagName(frameTag) || ownerElement->hasTagNa me(iframeTag)) 2119 if (ownerElement->hasTagName(frameTag) || ownerElement->hasTagNa me(iframeTag))
2124 frameElement = static_cast<HTMLFrameElement*>(ownerElement); 2120 frameElement = static_cast<HTMLFrameElement*>(ownerElement);
2125 2121
2126 if (frameElementAndViewPermitScroll(frameElement, frameView)) { 2122 if (frameElementAndViewPermitScroll(frameElement, frameView)) {
2127 LayoutRect viewRect = frameView->visibleContentRect(); 2123 LayoutRect viewRect = frameView->visibleContentRect();
2128 LayoutRect exposeRect = getRectToExpose(viewRect, rect, alig nX, alignY); 2124 LayoutRect exposeRect = getRectToExpose(viewRect, rect, alig nX, alignY);
2129 2125
2130 int xOffset = roundToInt(exposeRect.x()); 2126 int xOffset = roundToInt(exposeRect.x());
2131 int yOffset = roundToInt(exposeRect.y()); 2127 int yOffset = roundToInt(exposeRect.y());
2132 // Adjust offsets if they're outside of the allowable range. 2128 // Adjust offsets if they're outside of the allowable range.
2133 xOffset = max(0, min(frameView->contentsWidth(), xOffset)); 2129 xOffset = max(0, min(frameView->contentsWidth(), xOffset));
2134 yOffset = max(0, min(frameView->contentsHeight(), yOffset)); 2130 yOffset = max(0, min(frameView->contentsHeight(), yOffset));
2135 2131
2136 frameView->setScrollPosition(IntPoint(xOffset, yOffset)); 2132 frameView->setScrollPosition(IntPoint(xOffset, yOffset));
2137 if (frameView->safeToPropagateScrollToParent()) { 2133 if (frameView->safeToPropagateScrollToParent()) {
2138 parentLayer = ownerElement->renderer()->enclosingLayer() ; 2134 parentLayer = ownerElement->renderer()->enclosingLayer() ;
2135 // FIXME: This doesn't correctly convert the rect to
2136 // absolute coordinates in the parent.
2139 newRect.setX(rect.x() - frameView->scrollX() + frameView ->x()); 2137 newRect.setX(rect.x() - frameView->scrollX() + frameView ->x());
2140 newRect.setY(rect.y() - frameView->scrollY() + frameView ->y()); 2138 newRect.setY(rect.y() - frameView->scrollY() + frameView ->y());
2141 } else 2139 } else
2142 parentLayer = 0; 2140 parentLayer = 0;
2143 } 2141 }
2144 } else { 2142 } else {
2145 LayoutRect viewRect = frameView->visibleContentRect(); 2143 LayoutRect viewRect = frameView->visibleContentRect();
2146 LayoutRect r = getRectToExpose(viewRect, rect, alignX, alignY); 2144 LayoutRect r = getRectToExpose(viewRect, rect, alignX, alignY);
2147 2145
2148 frameView->setScrollPosition(roundedIntPoint(r.location())); 2146 frameView->setScrollPosition(roundedIntPoint(r.location()));
(...skipping 3619 matching lines...) Expand 10 before | Expand all | Expand 10 after
5768 } 5766 }
5769 } 5767 }
5770 5768
5771 void showLayerTree(const WebCore::RenderObject* renderer) 5769 void showLayerTree(const WebCore::RenderObject* renderer)
5772 { 5770 {
5773 if (!renderer) 5771 if (!renderer)
5774 return; 5772 return;
5775 showLayerTree(renderer->enclosingLayer()); 5773 showLayerTree(renderer->enclosingLayer());
5776 } 5774 }
5777 #endif 5775 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | Source/WebCore/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698