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

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

Issue 1459943002: Clip abspos descendants correctly in all columns (not just the first). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review - possible alternative Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 return newWidth != logicalWidth(); 289 return newWidth != logicalWidth();
290 } 290 }
291 291
292 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const 292 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const
293 { 293 {
294 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) 294 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet())
295 return columnSet->isPageLogicalHeightKnown(); 295 return columnSet->isPageLogicalHeightKnown();
296 return false; 296 return false;
297 } 297 }
298 298
299 LayoutSize LayoutMultiColumnFlowThread::offsetFromContainer(const LayoutObject* o, const LayoutPoint& point, bool* offsetDependsOnPoint) const
300 {
301 ASSERT(o == container());
302
303 // So far the point has been in flow thread coordinates (i.e. as if everythi ng in
304 // the fragmentation context lived in one tall single column). Convert it to a
305 // visual point now.
306
307 // TODO(mstensho): It's bad to assume that we want offsetFromContainer() to convert to visual
308 // coordinates. See LayoutBoxModelObject::mapAbsoluteToLocalPoint(). We real ly only want such
309 // conversions when walking *upwards* in the tree, but offsetFromContainer() has no idea why
310 // it's being called.
311 if (offsetDependsOnPoint)
312 *offsetDependsOnPoint = true;
313 return columnOffset(point) + topLeftLocationOffset();
314 }
315
299 LayoutSize LayoutMultiColumnFlowThread::flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread) const 316 LayoutSize LayoutMultiColumnFlowThread::flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread) const
300 { 317 {
301 LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offsetInFlowThread) ; 318 LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offsetInFlowThread) ;
302 if (!columnSet) 319 if (!columnSet)
303 return LayoutSize(0, 0); 320 return LayoutSize(0, 0);
304 return columnSet->flowThreadTranslationAtOffset(offsetInFlowThread); 321 return columnSet->flowThreadTranslationAtOffset(offsetInFlowThread);
305 } 322 }
306 323
307 LayoutPoint LayoutMultiColumnFlowThread::visualPointToFlowThreadPoint(const Layo utPoint& visualPoint) const 324 LayoutPoint LayoutMultiColumnFlowThread::visualPointToFlowThreadPoint(const Layo utPoint& visualPoint) const
308 { 325 {
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 // the "mayBe"), if we're in an out-of-flow subtree and have an outer multic ol container that 962 // the "mayBe"), if we're in an out-of-flow subtree and have an outer multic ol container that
946 // doesn't affect us, but that's okay. We'll discover that further down the road when trying to 963 // doesn't affect us, but that's okay. We'll discover that further down the road when trying to
947 // locate our enclosing flow thread for real. 964 // locate our enclosing flow thread for real.
948 bool mayBeNested = multiColumnBlockFlow()->isInsideFlowThread() || view()->f ragmentationContext(); 965 bool mayBeNested = multiColumnBlockFlow()->isInsideFlowThread() || view()->f ragmentationContext();
949 if (!mayBeNested) 966 if (!mayBeNested)
950 return; 967 return;
951 appendNewFragmentainerGroupIfNeeded(logicalTopInFlowThreadAfterPagination); 968 appendNewFragmentainerGroupIfNeeded(logicalTopInFlowThreadAfterPagination);
952 } 969 }
953 970
954 } 971 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698