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

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

Issue 1907443003: Translate flow thread coords to the nearest enclosing coord space when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a unit test too. 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
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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 if (LayoutBox* next = nextSiblingBox()) { 278 if (LayoutBox* next = nextSiblingBox()) {
279 if (next->isLayoutMultiColumnSpannerPlaceholder()) { 279 if (next->isLayoutMultiColumnSpannerPlaceholder()) {
280 // If we're followed by a spanner, we need to balance. 280 // If we're followed by a spanner, we need to balance.
281 return true; 281 return true;
282 } 282 }
283 } 283 }
284 } 284 }
285 return !flowThread->columnHeightAvailable(); 285 return !flowThread->columnHeightAvailable();
286 } 286 }
287 287
288 LayoutSize LayoutMultiColumnSet::flowThreadTranslationAtOffset(LayoutUnit blockO ffset) const 288 LayoutSize LayoutMultiColumnSet::flowThreadTranslationAtOffset(LayoutUnit blockO ffset, CoordinateSpaceConversion mode) const
289 { 289 {
290 return fragmentainerGroupAtFlowThreadOffset(blockOffset).flowThreadTranslati onAtOffset(blockOffset); 290 return fragmentainerGroupAtFlowThreadOffset(blockOffset).flowThreadTranslati onAtOffset(blockOffset, mode);
291 } 291 }
292 292
293 LayoutPoint LayoutMultiColumnSet::visualPointToFlowThreadPoint(const LayoutPoint & visualPoint) const 293 LayoutPoint LayoutMultiColumnSet::visualPointToFlowThreadPoint(const LayoutPoint & visualPoint) const
294 { 294 {
295 const MultiColumnFragmentainerGroup& row = fragmentainerGroupAtVisualPoint(v isualPoint); 295 const MultiColumnFragmentainerGroup& row = fragmentainerGroupAtVisualPoint(v isualPoint);
296 return row.visualPointToFlowThreadPoint(visualPoint - row.offsetFromColumnSe t()); 296 return row.visualPointToFlowThreadPoint(visualPoint - row.offsetFromColumnSe t());
297 } 297 }
298 298
299 LayoutUnit LayoutMultiColumnSet::pageLogicalTopForOffset(LayoutUnit offset) cons t 299 LayoutUnit LayoutMultiColumnSet::pageLogicalTopForOffset(LayoutUnit offset) cons t
300 { 300 {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 467
468 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const 468 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const
469 { 469 {
470 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi dth(), logicalHeightInFlowThread()); 470 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi dth(), logicalHeightInFlowThread());
471 if (!isHorizontalWritingMode()) 471 if (!isHorizontalWritingMode())
472 return portionRect.transposedRect(); 472 return portionRect.transposedRect();
473 return portionRect; 473 return portionRect;
474 } 474 }
475 475
476 } // namespace blink 476 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698