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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 1908353002: Shift visual-to-flowthread coordinate space conversion one level up in the tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after
2290 } else if (o->isBox()) { 2290 } else if (o->isBox()) {
2291 applyContainerFlip = o->style()->isFlippedBlocksWritingMode(); 2291 applyContainerFlip = o->style()->isFlippedBlocksWritingMode();
2292 mode &= ~ApplyContainerFlip; 2292 mode &= ~ApplyContainerFlip;
2293 } 2293 }
2294 } 2294 }
2295 2295
2296 if (!ancestorSkipped) 2296 if (!ancestorSkipped)
2297 o->mapAncestorToLocal(ancestor, transformState, mode); 2297 o->mapAncestorToLocal(ancestor, transformState, mode);
2298 2298
2299 LayoutSize containerOffset = offsetFromContainer(o); 2299 LayoutSize containerOffset = offsetFromContainer(o);
2300 if (o->isLayoutFlowThread()) { 2300 if (isLayoutFlowThread()) {
2301 // Descending into a flow thread. Convert to the local coordinate space, i.e. flow thread coordinates. 2301 // Descending into a flow thread. Convert to the local coordinate space, i.e. flow thread coordinates.
2302 LayoutPoint visualPoint = LayoutPoint(transformState.mappedPoint()); 2302 LayoutPoint visualPoint = LayoutPoint(transformState.mappedPoint());
2303 transformState.move(visualPoint - toLayoutFlowThread(o)->visualPointToFl owThreadPoint(visualPoint)); 2303 transformState.move(visualPoint - toLayoutFlowThread(this)->visualPointT oFlowThreadPoint(visualPoint));
2304 } 2304 }
2305 2305
2306 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl e()->preserves3D()); 2306 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl e()->preserves3D());
2307 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { 2307 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
2308 TransformationMatrix t; 2308 TransformationMatrix t;
2309 getTransformFromContainer(o, containerOffset, t); 2309 getTransformFromContainer(o, containerOffset, t);
2310 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate Transform : TransformState::FlattenTransform); 2310 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate Transform : TransformState::FlattenTransform);
2311 } else { 2311 } else {
2312 transformState.move(containerOffset.width(), containerOffset.height(), p reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo rm); 2312 transformState.move(containerOffset.width(), containerOffset.height(), p reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo rm);
2313 } 2313 }
(...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after
3685 const blink::LayoutObject* root = object1; 3685 const blink::LayoutObject* root = object1;
3686 while (root->parent()) 3686 while (root->parent())
3687 root = root->parent(); 3687 root = root->parent();
3688 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3688 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3689 } else { 3689 } else {
3690 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3690 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3691 } 3691 }
3692 } 3692 }
3693 3693
3694 #endif 3694 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698