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

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

Issue 2593633002: Need to be inside the flow thread before converting a visual point. (Closed)
Patch Set: Created 4 years 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. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 } else if (container->isBox()) { 2157 } else if (container->isBox()) {
2158 applyContainerFlip = container->style()->isFlippedBlocksWritingMode(); 2158 applyContainerFlip = container->style()->isFlippedBlocksWritingMode();
2159 mode &= ~ApplyContainerFlip; 2159 mode &= ~ApplyContainerFlip;
2160 } 2160 }
2161 } 2161 }
2162 2162
2163 if (!ancestorSkipped) 2163 if (!ancestorSkipped)
2164 container->mapAncestorToLocal(ancestor, transformState, mode); 2164 container->mapAncestorToLocal(ancestor, transformState, mode);
2165 2165
2166 LayoutSize containerOffset = offsetFromContainer(container); 2166 LayoutSize containerOffset = offsetFromContainer(container);
2167 if (isLayoutFlowThread()) {
2168 // Descending into a flow thread. Convert to the local coordinate space,
2169 // i.e. flow thread coordinates.
2170 LayoutPoint visualPoint = LayoutPoint(transformState.mappedPoint());
2171 transformState.move(
2172 visualPoint -
2173 toLayoutFlowThread(this)->visualPointToFlowThreadPoint(visualPoint));
2174 }
2175
2176 bool preserve3D = 2167 bool preserve3D =
2177 mode & UseTransforms && 2168 mode & UseTransforms &&
2178 (container->style()->preserves3D() || style()->preserves3D()); 2169 (container->style()->preserves3D() || style()->preserves3D());
2179 if (mode & UseTransforms && shouldUseTransformFromContainer(container)) { 2170 if (mode & UseTransforms && shouldUseTransformFromContainer(container)) {
2180 TransformationMatrix t; 2171 TransformationMatrix t;
2181 getTransformFromContainer(container, containerOffset, t); 2172 getTransformFromContainer(container, containerOffset, t);
2182 transformState.applyTransform(t, preserve3D 2173 transformState.applyTransform(t, preserve3D
2183 ? TransformState::AccumulateTransform 2174 ? TransformState::AccumulateTransform
2184 : TransformState::FlattenTransform); 2175 : TransformState::FlattenTransform);
2185 } else { 2176 } else {
2186 transformState.move(containerOffset.width(), containerOffset.height(), 2177 transformState.move(containerOffset.width(), containerOffset.height(),
2187 preserve3D ? TransformState::AccumulateTransform 2178 preserve3D ? TransformState::AccumulateTransform
2188 : TransformState::FlattenTransform); 2179 : TransformState::FlattenTransform);
2189 } 2180 }
2190 2181
2182 if (isLayoutFlowThread()) {
2183 // Descending into a flow thread. Convert to the local coordinate space,
2184 // i.e. flow thread coordinates.
2185 LayoutPoint visualPoint = LayoutPoint(transformState.mappedPoint());
2186 transformState.move(
2187 visualPoint -
2188 toLayoutFlowThread(this)->visualPointToFlowThreadPoint(visualPoint));
2189 }
2190
2191 if (applyContainerFlip) { 2191 if (applyContainerFlip) {
2192 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint()); 2192 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint());
2193 transformState.move( 2193 transformState.move(
2194 centerPoint - 2194 centerPoint -
2195 toLayoutBox(container)->flipForWritingMode(LayoutPoint(centerPoint))); 2195 toLayoutBox(container)->flipForWritingMode(LayoutPoint(centerPoint)));
2196 } 2196 }
2197 2197
2198 if (ancestorSkipped) { 2198 if (ancestorSkipped) {
2199 containerOffset = ancestor->offsetFromAncestorContainer(container); 2199 containerOffset = ancestor->offsetFromAncestorContainer(container);
2200 transformState.move(-containerOffset.width(), -containerOffset.height()); 2200 transformState.move(-containerOffset.width(), -containerOffset.height());
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after
3519 const blink::LayoutObject* root = object1; 3519 const blink::LayoutObject* root = object1;
3520 while (root->parent()) 3520 while (root->parent())
3521 root = root->parent(); 3521 root = root->parent();
3522 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3522 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3523 } else { 3523 } else {
3524 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3524 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3525 } 3525 }
3526 } 3526 }
3527 3527
3528 #endif 3528 #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