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

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

Issue 1819603003: Shift flowthread-to-visual coordinate space conversion one level up in the tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update unit tests. Created 4 years, 9 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
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 2250 matching lines...) Expand 10 before | Expand all | Expand 10 after
2261 } else if (o->isBox()) { 2261 } else if (o->isBox()) {
2262 if (o->style()->isFlippedBlocksWritingMode()) { 2262 if (o->style()->isFlippedBlocksWritingMode()) {
2263 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoin t()); 2263 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoin t());
2264 transformState.move(toLayoutBox(o)->flipForWritingMode(LayoutPoi nt(centerPoint)) - centerPoint); 2264 transformState.move(toLayoutBox(o)->flipForWritingMode(LayoutPoi nt(centerPoint)) - centerPoint);
2265 } 2265 }
2266 mode &= ~ApplyContainerFlip; 2266 mode &= ~ApplyContainerFlip;
2267 } 2267 }
2268 } 2268 }
2269 2269
2270 LayoutSize containerOffset = offsetFromContainer(o); 2270 LayoutSize containerOffset = offsetFromContainer(o);
2271 if (o->isLayoutFlowThread()) { 2271 if (isLayoutFlowThread()) {
2272 // So far the point has been in flow thread coordinates (i.e. as if ever ything in 2272 // So far the point has been in flow thread coordinates (i.e. as if ever ything in
2273 // the fragmentation context lived in one tall single column). Convert i t to a 2273 // the fragmentation context lived in one tall single column). Convert i t to a
2274 // visual point now. 2274 // visual point now, since we're about to escape the flow thread.
2275 LayoutPoint pointInContainer = roundedLayoutPoint(transformState.mappedP oint()) + containerOffset; 2275 containerOffset += columnOffset(roundedLayoutPoint(transformState.mapped Point()));
2276 containerOffset += o->columnOffset(pointInContainer);
2277 } 2276 }
2278 2277
2279 // Text objects just copy their parent's computed style, so we need to ignor e them. 2278 // Text objects just copy their parent's computed style, so we need to ignor e them.
2280 bool preserve3D = mode & UseTransforms && ((o->style()->preserves3D() && !o- >isText()) || (style()->preserves3D() && !isText())); 2279 bool preserve3D = mode & UseTransforms && ((o->style()->preserves3D() && !o- >isText()) || (style()->preserves3D() && !isText()));
2281 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { 2280 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
2282 TransformationMatrix t; 2281 TransformationMatrix t;
2283 getTransformFromContainer(o, containerOffset, t); 2282 getTransformFromContainer(o, containerOffset, t);
2284 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate Transform : TransformState::FlattenTransform); 2283 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate Transform : TransformState::FlattenTransform);
2285 } else { 2284 } else {
2286 transformState.move(containerOffset.width(), containerOffset.height(), p reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo rm); 2285 transformState.move(containerOffset.width(), containerOffset.height(), p reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo rm);
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after
3727 const blink::LayoutObject* root = object1; 3726 const blink::LayoutObject* root = object1;
3728 while (root->parent()) 3727 while (root->parent())
3729 root = root->parent(); 3728 root = root->parent();
3730 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3729 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3731 } else { 3730 } else {
3732 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3731 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3733 } 3732 }
3734 } 3733 }
3735 3734
3736 #endif 3735 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698