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

Side by Side Diff: sky/engine/core/rendering/RenderLayer.cpp

Issue 684393002: Remove flipForWritingMode. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
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 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after
1752 LayoutRect hitTestArea = renderer()->view()->documentRect(); 1752 LayoutRect hitTestArea = renderer()->view()->documentRect();
1753 if (!request.ignoreClipping()) 1753 if (!request.ignoreClipping())
1754 hitTestArea.intersect(frameVisibleRect(renderer())); 1754 hitTestArea.intersect(frameVisibleRect(renderer()));
1755 1755
1756 RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestAre a, hitTestLocation, false); 1756 RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestAre a, hitTestLocation, false);
1757 if (!insideLayer) { 1757 if (!insideLayer) {
1758 // We didn't hit any layer. If we are the root layer and the mouse is -- or just was -- down, 1758 // We didn't hit any layer. If we are the root layer and the mouse is -- or just was -- down,
1759 // return ourselves. We do this so mouse events continue getting deliver ed after a drag has 1759 // return ourselves. We do this so mouse events continue getting deliver ed after a drag has
1760 // exited the WebView, and so hit testing over a scrollbar hits the cont ent document. 1760 // exited the WebView, and so hit testing over a scrollbar hits the cont ent document.
1761 if (!request.isChildFrameHitTest() && (request.active() || request.relea se()) && isRootLayer()) { 1761 if (!request.isChildFrameHitTest() && (request.active() || request.relea se()) && isRootLayer()) {
1762 renderer()->updateHitTestResult(result, toRenderView(renderer())->fl ipForWritingMode(hitTestLocation.point())); 1762 renderer()->updateHitTestResult(result, hitTestLocation.point());
1763 insideLayer = this; 1763 insideLayer = this;
1764 } 1764 }
1765 } 1765 }
1766 1766
1767 // Now determine if the result is inside an anchor - if the urlElement isn't already set. 1767 // Now determine if the result is inside an anchor - if the urlElement isn't already set.
1768 Node* node = result.innerNode(); 1768 Node* node = result.innerNode();
1769 if (node && !result.URLElement()) 1769 if (node && !result.URLElement())
1770 result.setURLElement(node->enclosingLinkEventParentOrSelf()); 1770 result.setURLElement(node->enclosingLinkEventParentOrSelf());
1771 1771
1772 // Now return whether we were inside this layer (this will always be true fo r the root 1772 // Now return whether we were inside this layer (this will always be true fo r the root
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
2232 result = box->borderBoxRect(); 2232 result = box->borderBoxRect();
2233 result.unite(box->visualOverflowRect()); 2233 result.unite(box->visualOverflowRect());
2234 } 2234 }
2235 2235
2236 ASSERT(renderer()->view()); 2236 ASSERT(renderer()->view());
2237 return result; 2237 return result;
2238 } 2238 }
2239 2239
2240 LayoutRect RenderLayer::physicalBoundingBox(const RenderLayer* ancestorLayer, co nst LayoutPoint* offsetFromRoot) const 2240 LayoutRect RenderLayer::physicalBoundingBox(const RenderLayer* ancestorLayer, co nst LayoutPoint* offsetFromRoot) const
2241 { 2241 {
2242 LayoutRect result = logicalBoundingBox();
2243 if (m_renderer->isBox())
2244 renderBox()->flipForWritingMode(result);
2245 else
2246 m_renderer->containingBlock()->flipForWritingMode(result);
2247
2248 LayoutPoint delta; 2242 LayoutPoint delta;
2249 if (offsetFromRoot) 2243 if (offsetFromRoot)
2250 delta = *offsetFromRoot; 2244 delta = *offsetFromRoot;
2251 else 2245 else
2252 convertToLayerCoords(ancestorLayer, delta); 2246 convertToLayerCoords(ancestorLayer, delta);
2253 2247
2248 LayoutRect result = logicalBoundingBox();
2254 result.moveBy(delta); 2249 result.moveBy(delta);
2255 return result; 2250 return result;
2256 } 2251 }
2257 2252
2258 static void expandRectForReflectionAndStackingChildren(const RenderLayer* ancest orLayer, RenderLayer::CalculateBoundsOptions options, LayoutRect& result) 2253 static void expandRectForReflectionAndStackingChildren(const RenderLayer* ancest orLayer, RenderLayer::CalculateBoundsOptions options, LayoutRect& result)
2259 { 2254 {
2260 ASSERT(ancestorLayer->stackingNode()->isStackingContext() || !ancestorLayer- >stackingNode()->hasPositiveZOrderList()); 2255 ASSERT(ancestorLayer->stackingNode()->isStackingContext() || !ancestorLayer- >stackingNode()->hasPositiveZOrderList());
2261 2256
2262 #if ENABLE(ASSERT) 2257 #if ENABLE(ASSERT)
2263 LayerListMutationDetector mutationChecker(const_cast<RenderLayer*>(ancestorL ayer)->stackingNode()); 2258 LayerListMutationDetector mutationChecker(const_cast<RenderLayer*>(ancestorL ayer)->stackingNode());
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
2788 } 2783 }
2789 } 2784 }
2790 2785
2791 void showLayerTree(const blink::RenderObject* renderer) 2786 void showLayerTree(const blink::RenderObject* renderer)
2792 { 2787 {
2793 if (!renderer) 2788 if (!renderer)
2794 return; 2789 return;
2795 showLayerTree(renderer->enclosingLayer()); 2790 showLayerTree(renderer->enclosingLayer());
2796 } 2791 }
2797 #endif 2792 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBox.cpp ('k') | sky/engine/core/rendering/RenderLayerClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698